allow_origins for the server

parent 678f1b00
...@@ -36,15 +36,19 @@ class DIContainer: ...@@ -36,15 +36,19 @@ class DIContainer:
def create_app() -> FastAPI: def create_app() -> FastAPI:
app = FastAPI(title="Unified Chat API with Local Agent") app = FastAPI(title="Unified Chat API with Local Agent")
# Add CORS middleware
app.add_middleware( app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=["*"], allow_origins=[
"http://teamtestingdocker.caprover.al-arcade.com:8000",
"http://localhost:8000", # For local development
],
allow_credentials=True, allow_credentials=True,
allow_methods=["*"], allow_methods=["*"],
allow_headers=["*"], allow_headers=["*"],
expose_headers=["X-Response-Text"], expose_headers=["X-Response-Text"],
) )
# Initialize dependencies # Initialize dependencies
container = DIContainer() 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