diff --git a/server/main.py b/server/main.py index 4e1e2ca4..7ac25c8d 100644 --- a/server/main.py +++ b/server/main.py @@ -3,7 +3,7 @@ import uvicorn from fastapi import FastAPI from fastapi.responses import StreamingResponse - +from fastapi.middleware.cors import CORSMiddleware from agent import stream from uilts.env import get_env_variable @@ -21,6 +21,15 @@ description="Agent Chat APIs" ) +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], + expose_headers=["*"], +) + app.include_router(health_checker.router) app.include_router(github.router) app.include_router(rag.router)