Do0rMaMu commited on
Commit
9e93492
1 Parent(s): 1907b0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -7,11 +7,19 @@ from typing import List
7
 
8
  app = FastAPI()
9
 
 
 
 
 
 
 
 
10
  app.add_middleware(
11
  CORSMiddleware,
12
- allow_origins=["*"], # This allows all domains
13
- allow_methods=["*"], # This allows all methods
14
- allow_headers=["*"], # This allows all headers
 
15
  )
16
 
17
  class Box:
 
7
 
8
  app = FastAPI()
9
 
10
+ origins = [
11
+ "http://127.0.0.1:5500", # Allow your local development origin
12
+ "http://localhost:5500", # Sometimes localhost might also be used
13
+ "https://your-frontend-domain.com", # Add your production frontend domain here if applicable
14
+ "https://do0rmamu-truck-loading-poc.hf.space" # Add your current server URL here
15
+ ]
16
+
17
  app.add_middleware(
18
  CORSMiddleware,
19
+ allow_origins=origins, # List of allowed origins
20
+ allow_credentials=True,
21
+ allow_methods=["*"], # Allows all methods (GET, POST, etc.)
22
+ allow_headers=["*"], # Allows all headers
23
  )
24
 
25
  class Box: