Spaces:
Paused
Paused
Fix CORS configuration for Hugging Face Spaces production
Browse files
api.py
CHANGED
|
@@ -26,10 +26,10 @@ app = FastAPI(
|
|
| 26 |
version="1.0.0"
|
| 27 |
)
|
| 28 |
|
| 29 |
-
# Enable CORS for all origins (
|
| 30 |
app.add_middleware(
|
| 31 |
CORSMiddleware,
|
| 32 |
-
allow_origins=["*"],
|
| 33 |
allow_credentials=True,
|
| 34 |
allow_methods=["*"],
|
| 35 |
allow_headers=["*"],
|
|
|
|
| 26 |
version="1.0.0"
|
| 27 |
)
|
| 28 |
|
| 29 |
+
# Enable CORS for all origins (required for Hugging Face Spaces public API)
|
| 30 |
app.add_middleware(
|
| 31 |
CORSMiddleware,
|
| 32 |
+
allow_origins=["*"], # Allow all origins for public API access
|
| 33 |
allow_credentials=True,
|
| 34 |
allow_methods=["*"],
|
| 35 |
allow_headers=["*"],
|