powermeter/app/resources/__init__.py
Finn Christiansen c554194fb5
All checks were successful
/ Python-PEP8 (push) Successful in 12s
💚 Fix PEP8 warnings
2024-10-11 22:31:28 +02:00

13 lines
484 B
Python

def register_blueprints(api):
from . import impulses, consumption
resources = (impulses, consumption, )
for resource_blp in (res.bp for res in resources):
# Here we can register common handlers to all resources
#
# resource_blp.before_request(before_request_handler)
# resource_blp.after_request(after_request_handler)
api.register_blueprint(resource_blp,
url_prefix=f'/{resource_blp.url_prefix}')