From 00dd8a9abee6b9f0cfc37c6f20f30f0d99dfe91a Mon Sep 17 00:00:00 2001 From: fx Date: Wed, 25 Oct 2023 12:53:31 +0200 Subject: runs, no error handling --- src/routes/status.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/routes/status.rs (limited to 'src/routes/status.rs') 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 @@ +use std::sync::Arc; +use axum::extract::{State, WebSocketUpgrade}; +use axum::response::Response; +use serde::Deserialize; +use crate::AppState; +use crate::services::ping::status_websocket; + +#[axum_macros::debug_handler] +pub async fn status(State(state): State>, ws: WebSocketUpgrade) -> Response { + // TODO: remove unwrap + ws.on_upgrade(move |socket| status_websocket(socket, state.ping_send.clone(), state.ping_map.clone())) +} \ No newline at end of file -- cgit v1.2.3