From 31878d971e7ac24c00c559fd8cbb1ab50b0eb857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Ma=C3=AFzi?= Date: Wed, 30 Sep 2020 10:31:52 +0200 Subject: [PATCH] [routes] Add halfapi routes in production. --- halfapi/app.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/halfapi/app.py b/halfapi/app.py index 3049b84..0adf6dd 100644 --- a/halfapi/app.py +++ b/halfapi/app.py @@ -28,15 +28,14 @@ Only debug or doc routes, that should not be available in production routes = [ Route('/', get_api_routes) ] -if not PRODUCTION: - routes += [ - Route('/halfapi/current_user', lambda request, *args, **kwargs: - ORJSONResponse({'user':request.user.json}) - if type(request.user) != UnauthenticatedUser - else ORJSONResponse({'user': None})), - Route('/halfapi/schema', schema_json), - Route('/halfapi/acls', get_acls) - ] +routes += [ + Route('/halfapi/current_user', lambda request, *args, **kwargs: + ORJSONResponse({'user':request.user.json}) + if type(request.user) != UnauthenticatedUser + else ORJSONResponse({'user': None})), + Route('/halfapi/schema', schema_json), + Route('/halfapi/acls', get_acls) +] for domain, m_domain in DOMAINSDICT.items(): for route in gen_starlette_routes(m_domain):