small changes

This commit is contained in:
2026-03-16 10:56:52 +05:30
parent 0ca6c9c859
commit 8bea06be5e
6 changed files with 13 additions and 6 deletions

View File

@@ -24,10 +24,17 @@ app = FastAPI(
)
# CORS middleware (MUST be before routes)
cors_origins = [settings.frontend_url]
if settings.environment == "development":
cors_origins.extend([
"http://localhost:8000",
"http://127.0.0.1:8000",
"http://localhost:5173",
])
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:8000",
"http://127.0.0.1:8000", "http://localhost:5173"],
allow_origins=cors_origins,
allow_credentials=True,
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allow_headers=["*"],