Flask/project_name/ext/restapi/__init__.py
Simon Diesenreiter 5efd61d236
Some checks failed
CI / linter (ubuntu-latest, 3.9) (push) Failing after 1m29s
Rename the project from template / rename-project (push) Has been skipped
CI / tests_linux (ubuntu-latest, 3.9) (push) Has been skipped
initial commit
2024-11-10 07:27:36 -08:00

14 lines
362 B
Python

from flask import Blueprint
from flask_restful import Api
from .resources import ProductItemResource, ProductResource
bp = Blueprint("restapi", __name__, url_prefix="/api/v1")
api = Api(bp)
def init_app(app):
api.add_resource(ProductResource, "/product/")
api.add_resource(ProductItemResource, "/product/<product_id>")
app.register_blueprint(bp)