From 38798549f648349615529bc5ecf1a762d4d94599 Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Tue, 22 Sep 2020 14:11:00 +0200 Subject: [PATCH] =?UTF-8?q?[wip][app]=C2=A0adapt=20code=20to=20new=20route?= =?UTF-8?q?r=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- halfapi/app.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/halfapi/app.py b/halfapi/app.py index f86d3df..062fbdf 100644 --- a/halfapi/app.py +++ b/halfapi/app.py @@ -11,12 +11,13 @@ from starlette.middleware.authentication import AuthenticationMiddleware from typing import Any, Awaitable, Callable, MutableMapping # module libraries -from halfapi.conf import HOST, PORT, DB_NAME, SECRET, PRODUCTION +from halfapi.conf import HOST, PORT, DB_NAME, SECRET, PRODUCTION, DOMAINS from halfapi.lib.jwt_middleware import JWTAuthenticationBackend from halfapi.lib.responses import * -from halfapi.lib.routes import get_routes +from halfapi.lib.routes import get_starlette_routes +from halfapi.lib.domain import domain_scanner debug_routes = [ @@ -31,7 +32,8 @@ debug_routes = [ application = Starlette( debug=not PRODUCTION, - routes=debug_routes + get_routes(), + routes=debug_routes + [ route for route in + gen_starlette_routes(domain_scanner()) ], middleware=[ Middleware(AuthenticationMiddleware, backend=JWTAuthenticationBackend(secret_key=SECRET))