From 982607b670f3ff77a6265a08f2f1f13b34d0085e Mon Sep 17 00:00:00 2001 From: seeleng Date: Sat, 21 Sep 2024 04:40:35 +0800 Subject: [PATCH] fix: stop hardcoding frontend url --- backend/src/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/app.py b/backend/src/app.py index 9cba711f..d2f3abd2 100644 --- a/backend/src/app.py +++ b/backend/src/app.py @@ -6,6 +6,7 @@ import logging from src.common.base import Base +from src.common.constants import FRONTEND_URL from src.common.database import engine logging.getLogger("passlib").setLevel(logging.ERROR) @@ -19,8 +20,7 @@ async def lifespan(app: FastAPI): server = FastAPI(lifespan=lifespan) -# TODO: refactor to env variable -origins = ["http://localhost:3000"] +origins = [FRONTEND_URL] server.add_middleware( CORSMiddleware,