allow_origins for the server

parent 678f1b00
......@@ -36,16 +36,20 @@ class DIContainer:
def create_app() -> FastAPI:
app = FastAPI(title="Unified Chat API with Local Agent")
# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
expose_headers=["X-Response-Text"],
)
app.add_middleware(
CORSMiddleware,
allow_origins=[
"http://teamtestingdocker.caprover.al-arcade.com:8000",
"http://localhost:8000", # For local development
],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
expose_headers=["X-Response-Text"],
)
# Initialize dependencies
container = DIContainer()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment