This commit is contained in:
Philip Cheung 2024-10-07 17:43:45 +08:00
parent e7e9f5dc59
commit 9bbcebd63f
1 changed files with 3 additions and 3 deletions

View File

@ -22,10 +22,10 @@ app = FastAPI(
) )
# app.mount("/static", StaticFiles(directory="static"), name="static") # app.mount("/static", StaticFiles(directory="static"), name="static")
static_file_abspath = os.path.join(os.path.dirname(__file__), "static") # static_file_abspath = os.path.join(os.path.dirname(__file__), "static")
app.mount("/static", StaticFiles(directory=static_file_abspath), name="static")
# app.mount("/static", StaticFiles(directory=static_file_abspath), name="static")
app.mount('/static', StaticFiles(directory=os.path.join(current_dir, 'static')), name='static')
# Set all CORS enabled origins # Set all CORS enabled origins
if settings.BACKEND_CORS_ORIGINS: if settings.BACKEND_CORS_ORIGINS:
app.add_middleware( app.add_middleware(