Jaykay73 commited on
Restrict CORS to specific frontend domain
Browse filesUpdated CORS settings to allow requests from the specified frontend domain.
app.py
CHANGED
|
@@ -19,7 +19,7 @@ app = FastAPI(
|
|
| 19 |
# Enable CORS (Allows your frontend to talk to this API)
|
| 20 |
app.add_middleware(
|
| 21 |
CORSMiddleware,
|
| 22 |
-
allow_origins=["
|
| 23 |
allow_credentials=True,
|
| 24 |
allow_methods=["*"],
|
| 25 |
allow_headers=["*"],
|
|
@@ -174,4 +174,4 @@ def trigger_update(background_tasks: BackgroundTasks):
|
|
| 174 |
|
| 175 |
# --- Entry Point ---
|
| 176 |
if __name__ == "__main__":
|
| 177 |
-
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
|
|
| 19 |
# Enable CORS (Allows your frontend to talk to this API)
|
| 20 |
app.add_middleware(
|
| 21 |
CORSMiddleware,
|
| 22 |
+
allow_origins=["https://aether-match.vercel.app"], # In production, replace with specific domain
|
| 23 |
allow_credentials=True,
|
| 24 |
allow_methods=["*"],
|
| 25 |
allow_headers=["*"],
|
|
|
|
| 174 |
|
| 175 |
# --- Entry Point ---
|
| 176 |
if __name__ == "__main__":
|
| 177 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|