Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=
|
13 |
-
|
14 |
-
|
|
|
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:
|