Compare commits

...
2 Commits
Author SHA1 Message Date
matitos ba7a69c1ce Merge pull request 'Add a friendly GET /api/ws response' (#4) from chore/retrigger-deploy into main
CI/CD / backend (push) Successful in 5m24s
CI/CD / frontend (push) Successful in 5m14s
CI/CD / build (push) Successful in 54s
CI/CD / cleanup (push) Successful in 7s
CI/CD / deploy (push) Failing after 12s
2026-09-19 15:58:16 +02:00
matitos 386137c90e Add a friendly GET /api/ws response
CI/CD / backend (pull_request) Canceled after 0s
CI/CD / frontend (pull_request) Canceled after 0s
CI/CD / build (pull_request) Canceled after 0s
CI/CD / deploy (pull_request) Canceled after 0s
CI/CD / cleanup (pull_request) Canceled after 0s
A plain browser hit on the socket URL now returns a JSON hint instead of a
confusing 404/426. Companion to the Basic-auth bypass on /api/ws.
2026-09-19 13:41:55 +00:00
+9
View File
@@ -191,6 +191,15 @@ async def close_position(
return engine.status()
@router.get("/ws")
def websocket_info() -> dict[str, str]:
"""A plain browser hit on the socket URL gets a clear hint, not a 404/426."""
return {
"detail": "This endpoint is a WebSocket. Connect with a WebSocket client.",
"path": "/api/ws",
}
@router.websocket("/ws")
async def websocket_endpoint(websocket: WebSocket) -> None:
runtime: Runtime = websocket.app.state.runtime