Skip to content

Commit

Permalink
add back cors stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Jun 18, 2024
1 parent c39697d commit 3c2603c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion store/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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=["*"],
Expand Down

0 comments on commit 3c2603c

Please sign in to comment.