VcRlAgent commited on
Commit
3fc0e6d
·
1 Parent(s): e8b2c52

Initial WorkWise backend merged main.py -> app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -29,6 +29,15 @@ with gr.Blocks() as demo:
29
  # Access FastAPI app from Gradio
30
  app = demo.app
31
 
 
 
 
 
 
 
 
 
 
32
  # Add your custom routes to Gradio's underlying FastAPI app
33
  from app.routes import ingest_routes, ask_routes, metrics_routes
34
 
 
29
  # Access FastAPI app from Gradio
30
  app = demo.app
31
 
32
+ # CORS Middleware
33
+ app.add_middleware(
34
+ CORSMiddleware,
35
+ allow_origins=settings.ALLOWED_ORIGINS,
36
+ allow_credentials=True,
37
+ allow_methods=["*"],
38
+ allow_headers=["*"],
39
+ )
40
+
41
  # Add your custom routes to Gradio's underlying FastAPI app
42
  from app.routes import ingest_routes, ask_routes, metrics_routes
43