From e7e9f5dc59864a83b78efca3c3ef5b8c327bb581 Mon Sep 17 00:00:00 2001 From: Philip Cheung Date: Mon, 7 Oct 2024 17:40:32 +0800 Subject: [PATCH] edited static path --- backend/app/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/app/main.py b/backend/app/main.py index d941db2..bb654ba 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -22,9 +22,10 @@ app = FastAPI( ) # app.mount("/static", StaticFiles(directory="static"), name="static") -script_dir = os.path.dirname(__file__) -st_abs_file_path = os.path.join(script_dir, "static/") -app.mount("/static", StaticFiles(directory=st_abs_file_path), name="static") +static_file_abspath = os.path.join(os.path.dirname(__file__), "static") + +app.mount("/static", StaticFiles(directory=static_file_abspath), name="static") + # Set all CORS enabled origins if settings.BACKEND_CORS_ORIGINS: app.add_middleware(