summaryrefslogtreecommitdiff
path: root/src/routes/status.rs
diff options
context:
space:
mode:
authorfx <[email protected]>2023-10-25 12:53:31 +0200
committerfx <[email protected]>2023-10-25 12:53:31 +0200
commit00dd8a9abee6b9f0cfc37c6f20f30f0d99dfe91a (patch)
tree7906b5836f3ca24686b1b7418c2128b93c33a398 /src/routes/status.rs
parentf9224ff02e688dec819ab81893320a0611f2a198 (diff)
downloadwebol-00dd8a9abee6b9f0cfc37c6f20f30f0d99dfe91a.tar
webol-00dd8a9abee6b9f0cfc37c6f20f30f0d99dfe91a.tar.gz
webol-00dd8a9abee6b9f0cfc37c6f20f30f0d99dfe91a.zip
runs, no error handling
Diffstat (limited to 'src/routes/status.rs')
-rw-r--r--src/routes/status.rs12
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 @@
1use std::sync::Arc;
2use axum::extract::{State, WebSocketUpgrade};
3use axum::response::Response;
4use serde::Deserialize;
5use crate::AppState;
6use crate::services::ping::status_websocket;
7
8#[axum_macros::debug_handler]
9pub 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