diff options
Diffstat (limited to 'src/routes/status.rs')
-rw-r--r-- | src/routes/status.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/routes/status.rs b/src/routes/status.rs new file mode 100644 index 0000000..cdecf6a --- /dev/null +++ b/src/routes/status.rs | |||
@@ -0,0 +1,12 @@ | |||
1 | use std::sync::Arc; | ||
2 | use axum::extract::{State, WebSocketUpgrade}; | ||
3 | use axum::response::Response; | ||
4 | use serde::Deserialize; | ||
5 | use crate::AppState; | ||
6 | use crate::services::ping::status_websocket; | ||
7 | |||
8 | #[axum_macros::debug_handler] | ||
9 | pub async fn status(State(state): State<Arc<AppState>>, ws: WebSocketUpgrade) -> Response { | ||
10 | // TODO: remove unwrap | ||
11 | ws.on_upgrade(move |socket| status_websocket(socket, state.ping_send.clone(), state.ping_map.clone())) | ||
12 | } \ No newline at end of file | ||