small changes
This commit is contained in:
Binary file not shown.
@@ -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=["*"],
|
||||
|
||||
@@ -5,4 +5,3 @@ pydantic==2.5.0
|
||||
python-dotenv==1.0.0
|
||||
pydantic-settings==2.1.0
|
||||
python-multipart==0.0.6
|
||||
cors==1.0.1
|
||||
|
||||
Reference in New Issue
Block a user