From 1e733c9f246cff83fc169d7d7a45887ee820dd90 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/app.py b/backend/src/app.py index 9cba711f..aae4c3f0 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) @@ -20,7 +21,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,