__init__.py 516 B

1234567891011121314151617
  1. """
  2. Functionality common to all API versions.
  3. """
  4. from flask import Flask, Blueprint
  5. # The api blueprint. It is registered with the Flask app (see register_at)
  6. flexmeasures_api = Blueprint("flexmeasures_api_ops", __name__)
  7. def register_at(app: Flask):
  8. """This can be used to register this blueprint together with other api-related things"""
  9. import flexmeasures.api.common.routes # noqa: F401 this is necessary to load the endpoints
  10. app.register_blueprint(flexmeasures_api, url_prefix="/api/ops")