From 7f0e2d0a0785b604060b52c2fbfeba621eb1fd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Ma=C3=AFzi?= Date: Wed, 5 Aug 2020 10:34:54 +0200 Subject: [PATCH] [cli] Print routes when running application. --- halfapi/cli/__init__.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/halfapi/cli/__init__.py b/halfapi/cli/__init__.py index d5160a1..63a19af 100644 --- a/halfapi/cli/__init__.py +++ b/halfapi/cli/__init__.py @@ -12,6 +12,13 @@ from configparser import ConfigParser from halfapi import __version__ from halfapi.cli.lib.db import ProjectDB +from halfapi.conf import DOMAINS +from halfapi.db import ( + Domain, + APIRouter, + APIRoute, + AclFunction, + Acl) CONTEXT_SETTINGS = { } @@ -65,6 +72,7 @@ def run(host, port): click.echo('Launching application') sys.path.insert(0, BASE_DIR) + list_routes(DOMAINS) uvicorn.run('halfapi.app:application', host=host, @@ -97,16 +105,7 @@ def routes(domain, update): update (boolean): If set, update the database for the selected domains """ - from halfapi.db import ( - Domain, - APIRouter, - APIRoute, - AclFunction, - Acl) - global Domain, APIRouter, APIRoute, AclFunction, Acl - - from halfapi.conf import DOMAINS if not domain: domain = DOMAINS else: