diff --git a/applications/cls-cad-backend/cls_cad_backend/server.py b/applications/cls-cad-backend/cls_cad_backend/server.py index 47b5628..b8736eb 100644 --- a/applications/cls-cad-backend/cls_cad_backend/server.py +++ b/applications/cls-cad-backend/cls_cad_backend/server.py @@ -12,7 +12,7 @@ get_taxonomy_for_project, upsert_part, upsert_result, - upsert_taxonomy, + upsert_taxonomy, init_database, ) from cls_cad_backend.repository_builder import RepositoryBuilder, wrapped_counted_types from cls_cad_backend.responses import FastResponse @@ -37,6 +37,8 @@ from starlette.background import BackgroundTasks from starlette.staticfiles import StaticFiles +init_database() + origins = [ "http://localhost:3000", "http://localhost:8000", diff --git a/applications/cls-cad-backend/main.py b/applications/cls-cad-backend/main.py index b30233e..f520df5 100644 --- a/applications/cls-cad-backend/main.py +++ b/applications/cls-cad-backend/main.py @@ -4,13 +4,11 @@ def start(): """Launched with `poetry run start` at root level.""" - init_database() uvicorn.run("cls_cad_backend.server:app", reload=True) def start_docker(): """Launched with `poetry run start` at root level.""" - init_database() uvicorn.run("cls_cad_backend.server:app", reload=False, host="0.0.0.0", port=80)