From 7e99e31f43468b579378080f6603c4415e5208bb Mon Sep 17 00:00:00 2001 From: boyska Date: Wed, 25 Aug 2021 14:50:13 +0200 Subject: [PATCH] "techrec serve" works now --- techrec/server.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/techrec/server.py b/techrec/server.py index afd577a..224b41b 100644 --- a/techrec/server.py +++ b/techrec/server.py @@ -43,6 +43,8 @@ def rec_sanitize(rec): async def startup_event(): global db common_pre() + if get_config()['DEBUG']: + logging.basicConfig(level=logging.DEBUG) db = RecDB(get_config()["DB_URI"]) @app.get("/date/date") @@ -339,6 +341,9 @@ def serve_pages(request: Request): fpath = os.path.join(get_config()["STATIC_PAGES"], page) return FileResponse(fpath) +def main_cmd(options): + import uvicorn + uvicorn.run(app, host=get_config()['HOST'], port=int(get_config()['PORT'])) if __name__ == "__main__": logger.warn("Usage of server.py is not supported anymore; use cli.py")