diff --git a/store/app/main.py b/store/app/main.py index ff50d0d8..1abe9e38 100644 --- a/store/app/main.py +++ b/store/app/main.py @@ -12,6 +12,12 @@ from store.app.routers.part import parts_router from store.app.routers.robot import robots_router from store.app.routers.users import users_router +from store.settings import settings + +LOCALHOST_URLS = [ + "http://127.0.0.1:3000", + "http://localhost:3000", +] @asynccontextmanager @@ -29,7 +35,7 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]: # Adds CORS middleware. app.add_middleware( CORSMiddleware, - allow_origins=["*"], + allow_origins={settings.site.homepage, *LOCALHOST_URLS}, allow_credentials=True, allow_methods=["*"], allow_headers=["*"],