djaydenvanhattem3 commited on
Commit
168b5df
·
verified ·
1 Parent(s): 6ea2463

Update ai-bot/app/main.py

Browse files
Files changed (1) hide show
  1. ai-bot/app/main.py +16 -1
ai-bot/app/main.py CHANGED
@@ -7,4 +7,19 @@ app.include_router(router)
7
 
8
  @app.get("/")
9
  def root():
10
- return {"status": "AI bot running"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  @app.get("/")
9
  def root():
10
+ return {"status": "AI bot running"}
11
+
12
+ from fastapi.middleware.cors import CORSMiddleware
13
+
14
+ origins = [
15
+ "https://yourdomain.com",
16
+ "http://localhost:3000"
17
+ ]
18
+
19
+ app.add_middleware(
20
+ CORSMiddleware,
21
+ allow_origins=origins,
22
+ allow_credentials=True,
23
+ allow_methods=["*"],
24
+ allow_headers=["*"],
25
+ )