snikhilesh commited on
Commit
a6fd0ad
·
verified ·
1 Parent(s): fcb6742

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. backend/main.py +3 -2
backend/main.py CHANGED
@@ -127,10 +127,11 @@ async def serve_react_app(full_path: str):
127
  static_dir = Path(__file__).parent / "static"
128
  index_file = static_dir / "index.html"
129
 
130
- # Only serve the React app for routes that don't start with API paths
131
- if full_path.startswith(('api', 'assets', 'health', 'analyze', 'status', 'results', 'supported-models', 'compliance-status')):
132
  raise HTTPException(status_code=404, detail="API endpoint not found")
133
 
 
134
  if index_file.exists():
135
  return FileResponse(index_file)
136
  else:
 
127
  static_dir = Path(__file__).parent / "static"
128
  index_file = static_dir / "index.html"
129
 
130
+ # Check if this is an API route or static file
131
+ if (full_path.startswith(('api', 'health', 'analyze', 'status', 'results', 'supported-models', 'compliance-status', 'assets'))):
132
  raise HTTPException(status_code=404, detail="API endpoint not found")
133
 
134
+ # Serve React app for everything else (client-side routing)
135
  if index_file.exists():
136
  return FileResponse(index_file)
137
  else: