docs(code): document websocket flow

This commit is contained in:
2026-06-16 14:30:21 +03:30
parent 0103dafc80
commit 932574b0c9
5 changed files with 35 additions and 3 deletions

View File

@@ -12,10 +12,11 @@ STATIC_DIR = BASE_DIR / "static"
app = FastAPI(title="Simple WebSocket Chatroom")
# WebSocket route: ws://localhost:8000/ws/{room_id}/{client_id}
# Registers the WebSocket endpoint:
# ws://localhost:8000/ws/{room_id}/{client_id}
app.include_router(chat_router)
# Frontend files
# Serves CSS, JavaScript, font files, and the main HTML page from app/static.
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
@@ -27,7 +28,7 @@ async def home():
@app.get("/api/rooms")
async def rooms():
"""Small helper endpoint for the GUI/debugging."""
"""Return active rooms and users for simple debugging during the demo."""
return manager.rooms_overview()