MarfinF commited on
Commit
0d79f5c
·
1 Parent(s): b3cc934

- never give up accessing static file

Browse files
Files changed (1) hide show
  1. backend/app.py +4 -6
backend/app.py CHANGED
@@ -179,12 +179,10 @@ async def chat_endpoint(websocket: WebSocket, username: str):
179
  del clients[username]
180
  await broadcast_user_list()
181
 
182
- @app.get("/frontend/{path:path}")
183
- async def serve_frontend(path: str):
184
- full_path = os.path.join("frontend", path)
185
- if os.path.exists(full_path):
186
- return FileResponse(full_path)
187
- return {"error": "File not found"}
188
 
189
  if __name__ == "__main__":
190
  uvicorn.run(app, host="0.0.0.0", port=7860)
 
179
  del clients[username]
180
  await broadcast_user_list()
181
 
182
+ @app.get("/frontend")
183
+ def read_root():
184
+ print("frontend")
185
+ return FileResponse("frontend/index.html")
 
 
186
 
187
  if __name__ == "__main__":
188
  uvicorn.run(app, host="0.0.0.0", port=7860)