File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed
Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change 22
33import uvicorn
44from 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
87AGENT_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
1413SERVE_WEB_INTERFACE = True
1514
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-
3525if __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 )))
You can’t perform that action at this time.
0 commit comments