Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,8 +27,8 @@ FRONTEND_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fronten
|
|
| 27 |
@app.route('/<path:path>')
|
| 28 |
def serve_react(path):
|
| 29 |
"""Serve React SPA. Static assets go to dist/, everything else → index.html."""
|
| 30 |
-
# Never intercept API or socket.io requests
|
| 31 |
-
if path.startswith('api/') or path.startswith('socket.io'):
|
| 32 |
abort(404)
|
| 33 |
if path and os.path.exists(os.path.join(FRONTEND_DIR, path)):
|
| 34 |
res = send_from_directory(FRONTEND_DIR, path)
|
|
|
|
| 27 |
@app.route('/<path:path>')
|
| 28 |
def serve_react(path):
|
| 29 |
"""Serve React SPA. Static assets go to dist/, everything else → index.html."""
|
| 30 |
+
# Never intercept API, uploads, or socket.io requests
|
| 31 |
+
if path.startswith('api/') or path.startswith('uploads/') or path.startswith('socket.io'):
|
| 32 |
abort(404)
|
| 33 |
if path and os.path.exists(os.path.join(FRONTEND_DIR, path)):
|
| 34 |
res = send_from_directory(FRONTEND_DIR, path)
|