Spaces:
Sleeping
Sleeping
- fix static file html
Browse files- backend/app.py +1 -5
backend/app.py
CHANGED
|
@@ -18,7 +18,7 @@ sys.path.append(".")
|
|
| 18 |
|
| 19 |
app = FastAPI()
|
| 20 |
|
| 21 |
-
app.mount("/
|
| 22 |
|
| 23 |
app.add_middleware(
|
| 24 |
CORSMiddleware,
|
|
@@ -179,9 +179,5 @@ async def chat_endpoint(websocket: WebSocket, username: str):
|
|
| 179 |
del clients[username]
|
| 180 |
await broadcast_user_list()
|
| 181 |
|
| 182 |
-
@app.get("/")
|
| 183 |
-
def read_root():
|
| 184 |
-
return FileResponse("frontend/index.html")
|
| 185 |
-
|
| 186 |
if __name__ == "__main__":
|
| 187 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 18 |
|
| 19 |
app = FastAPI()
|
| 20 |
|
| 21 |
+
app.mount("/", StaticFiles(directory="frontend", html=True), name="frontend")
|
| 22 |
|
| 23 |
app.add_middleware(
|
| 24 |
CORSMiddleware,
|
|
|
|
| 179 |
del clients[username]
|
| 180 |
await broadcast_user_list()
|
| 181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
if __name__ == "__main__":
|
| 183 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|