Spaces:
Sleeping
Sleeping
Update backend/server.py
Browse files- backend/server.py +8 -1
backend/server.py
CHANGED
|
@@ -24,7 +24,14 @@ except Exception as e:
|
|
| 24 |
|
| 25 |
# --- CONFIGURATION SERVEUR & SÉCURITÉ (CORS) ---
|
| 26 |
# C'EST ICI LA CORRECTION CRITIQUE (LIGNE 25) :
|
| 27 |
-
sio = socketio.AsyncServer(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
app = FastAPI()
|
| 30 |
# Middleware pour autoriser les requêtes API REST classiques
|
|
|
|
| 24 |
|
| 25 |
# --- CONFIGURATION SERVEUR & SÉCURITÉ (CORS) ---
|
| 26 |
# C'EST ICI LA CORRECTION CRITIQUE (LIGNE 25) :
|
| 27 |
+
sio = socketio.AsyncServer(
|
| 28 |
+
async_mode='asgi',
|
| 29 |
+
cors_allowed_origins=[
|
| 30 |
+
"https://startech-final.vercel.app",
|
| 31 |
+
"http://localhost:3000",
|
| 32 |
+
"*"
|
| 33 |
+
]
|
| 34 |
+
)
|
| 35 |
|
| 36 |
app = FastAPI()
|
| 37 |
# Middleware pour autoriser les requêtes API REST classiques
|