diff --git a/halfapi/cli.py b/halfapi/cli.py index aae92ab..3d020fa 100755 --- a/halfapi/cli.py +++ b/halfapi/cli.py @@ -41,7 +41,7 @@ def run(host, port): sys.path.insert(0, BASE_DIR) click.echo(f'current python_path : {sys.path}') - uvicorn.run('halfapi.app:app', + uvicorn.run('halfapi.app:application', host=host, port=int(port), log_level=log_level, diff --git a/halfapi/conf.py b/halfapi/conf.py index ad7d901..d0be08f 100644 --- a/halfapi/conf.py +++ b/halfapi/conf.py @@ -24,7 +24,7 @@ if len(PROJECT_NAME) == 0: raise Exception('Need a project name as argument') -CONF_DIR = environ.get('HALFAPI_CONF_DIR', '/etc/halfapi') +CONF_DIR = environ.get('HALFAPI_CONF_DIR', '/etc/half_api') config.read(filenames=[os.path.join( CONF_DIR, @@ -33,8 +33,8 @@ config.read(filenames=[os.path.join( HOST = config.get('project', 'host') PORT = config.getint('project', 'port') - DB_NAME = f'halfapi_{PROJECT_NAME}' + with open(config.get('project', 'secret')) as secret_file: SECRET = secret_file.read() diff --git a/halfapi/lib/routes.py b/halfapi/lib/routes.py index f60f006..b2a1db2 100644 --- a/halfapi/lib/routes.py +++ b/halfapi/lib/routes.py @@ -46,7 +46,7 @@ def get_routes(domains=None): return caller app_routes = [] - for domaine_name in DOMAINS: + for domain_name in DOMAINS: try: domain = next(Domain(name=domain_name).select()) except StopIteration: