bekzhanK1 commited on
Commit
93ade99
·
1 Parent(s): 26dd2fe

Fix CORS configuration for Hugging Face Spaces production

Browse files
Files changed (1) hide show
  1. api.py +2 -2
api.py CHANGED
@@ -26,10 +26,10 @@ app = FastAPI(
26
  version="1.0.0"
27
  )
28
 
29
- # Enable CORS for all origins (adjust in production)
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=["*"],