docs(code): document websocket flow
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user