Codegeass321 commited on
Commit
4c39633
·
1 Parent(s): 4916117

Resolved CorsError

Browse files
Files changed (1) hide show
  1. api.py +7 -1
api.py CHANGED
@@ -23,9 +23,15 @@ load_dotenv()
23
 
24
  app = FastAPI()
25
 
 
 
 
 
 
 
26
  app.add_middleware(
27
  CORSMiddleware,
28
- allow_origins=["*"],
29
  allow_credentials=True,
30
  allow_methods=["*"],
31
  allow_headers=["*"],
 
23
 
24
  app = FastAPI()
25
 
26
+ # Define the specific origins that are allowed to make requests to your API
27
+ origins = [
28
+ "http://localhost:3000", # For local development
29
+ "https://chat-docx-ai-vercel.vercel.app",
30
+ ]
31
+
32
  app.add_middleware(
33
  CORSMiddleware,
34
+ allow_origins=origins,
35
  allow_credentials=True,
36
  allow_methods=["*"],
37
  allow_headers=["*"],