larxius commited on
Commit
6177f18
·
verified ·
1 Parent(s): b2cee32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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)