diff options
author | FxQnLr <[email protected]> | 2023-11-06 11:09:34 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-06 11:09:34 +0100 |
commit | 1cd2a8e4aecfaad2a8385a6bea61580209b86398 (patch) | |
tree | c357bcaca0681caf9a6742c857bb494dc4315900 /src/routes/status.rs | |
parent | d9d7b125e4fcaa3aedd7b57a69e6880e012ccf33 (diff) | |
parent | 32561060a8dc6fc6118498da06bdd8f5b4c3f0fd (diff) | |
download | webol-1cd2a8e4aecfaad2a8385a6bea61580209b86398.tar webol-1cd2a8e4aecfaad2a8385a6bea61580209b86398.tar.gz webol-1cd2a8e4aecfaad2a8385a6bea61580209b86398.zip |
Merge pull request #6 from FxQnLr/ping
Ping
Diffstat (limited to 'src/routes/status.rs')
-rw-r--r-- | src/routes/status.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/routes/status.rs b/src/routes/status.rs new file mode 100644 index 0000000..45f3e51 --- /dev/null +++ b/src/routes/status.rs | |||
@@ -0,0 +1,10 @@ | |||
1 | use std::sync::Arc; | ||
2 | use axum::extract::{State, WebSocketUpgrade}; | ||
3 | use axum::response::Response; | ||
4 | use crate::AppState; | ||
5 | use crate::services::ping::status_websocket; | ||
6 | |||
7 | #[axum_macros::debug_handler] | ||
8 | pub async fn status(State(state): State<Arc<AppState>>, ws: WebSocketUpgrade) -> Response { | ||
9 | ws.on_upgrade(move |socket| status_websocket(socket, state)) | ||
10 | } \ No newline at end of file | ||