"techrec serve" works now
This commit is contained in:
parent
fb79a598da
commit
7e99e31f43
1 changed files with 5 additions and 0 deletions
|
@ -43,6 +43,8 @@ def rec_sanitize(rec):
|
||||||
async def startup_event():
|
async def startup_event():
|
||||||
global db
|
global db
|
||||||
common_pre()
|
common_pre()
|
||||||
|
if get_config()['DEBUG']:
|
||||||
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
db = RecDB(get_config()["DB_URI"])
|
db = RecDB(get_config()["DB_URI"])
|
||||||
|
|
||||||
@app.get("/date/date")
|
@app.get("/date/date")
|
||||||
|
@ -339,6 +341,9 @@ def serve_pages(request: Request):
|
||||||
fpath = os.path.join(get_config()["STATIC_PAGES"], page)
|
fpath = os.path.join(get_config()["STATIC_PAGES"], page)
|
||||||
return FileResponse(fpath)
|
return FileResponse(fpath)
|
||||||
|
|
||||||
|
def main_cmd(options):
|
||||||
|
import uvicorn
|
||||||
|
uvicorn.run(app, host=get_config()['HOST'], port=int(get_config()['PORT']))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
logger.warn("Usage of server.py is not supported anymore; use cli.py")
|
logger.warn("Usage of server.py is not supported anymore; use cli.py")
|
||||||
|
|
Loading…
Reference in a new issue