Skip to content

Commit

Permalink
Register V1 router
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoninbln committed Jul 27, 2020
1 parent 00753a4 commit d39cebf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
13 changes: 0 additions & 13 deletions nestor_api/api/api.py

This file was deleted.

12 changes: 12 additions & 0 deletions nestor_api/api/api_routes/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Register all routes under the /api prefixes. The route /heartbeat is not included."""
from flask import Blueprint

from nestor_api.api.api_routes.v1 import create_api_v1


def get_apis() -> list:
"""Return the list of apis to register."""

return [
create_api_v1(),
]
6 changes: 3 additions & 3 deletions nestor_api/api/flask_app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Return an initialized Flask application with the API."""
from flask import Flask

from nestor_api.api.api import create_api
from nestor_api.api.api_routes.api import get_apis
from nestor_api.api.public_routes import heartbeat


Expand All @@ -12,7 +12,7 @@ def create_app() -> Flask:
# Note: heartbeat is exposed without authentication
app.register_blueprint(heartbeat.blueprint)

api = create_api()
app.register_blueprint(api)
for api in get_apis():
app.register_blueprint(api)

return app

0 comments on commit d39cebf

Please sign in to comment.