Skip to content

Commit f4043c4

Browse files
committed
fix:cors
1 parent 492dd6b commit f4043c4

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

main.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
import uvicorn
44
from google.adk.cli.fast_api import get_fast_api_app
5-
from fastapi.middleware.cors import CORSMiddleware
65

76
# Get the directory where main.py is located
87
AGENT_DIR = os.path.dirname(os.path.abspath(__file__))
98
# Example session DB URL (e.g., SQLite)
109
# SESSION_DB_URL = "sqlite:///./sessions.db"
1110
# Example allowed origins for CORS
12-
ALLOWED_ORIGINS = ["https://chaos-pilot.vercel.app"]
11+
ALLOWED_ORIGINS = ["*"]
1312
# Set web=True if you intend to serve a web interface, False otherwise
1413
SERVE_WEB_INTERFACE = True
1514

@@ -23,15 +22,6 @@
2322
web=SERVE_WEB_INTERFACE,
2423
)
2524

26-
# --- Add CORS middleware explicitly ---
27-
app.add_middleware(
28-
CORSMiddleware,
29-
allow_origins=ALLOWED_ORIGINS, # Or ["*"]
30-
allow_credentials=True,
31-
allow_methods=["*"],
32-
allow_headers=["*"],
33-
)
34-
3525
if __name__ == "__main__":
3626
# Use the PORT environment variable provided by Cloud Run, defaulting to 8080
3727
uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", 8080)))

0 commit comments

Comments
 (0)