summaryrefslogtreecommitdiff
path: root/src/routes/status.rs
blob: 4a5ec674cbc2ac177ee05d7fd8703f554d966a5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
use std::sync::Arc;
use axum::extract::{State, WebSocketUpgrade};
use axum::response::Response;
use crate::AppState;
use crate::services::ping::status_websocket;

#[axum_macros::debug_handler]
pub async fn status(State(state): State<Arc<AppState>>, ws: WebSocketUpgrade) -> Response {
    ws.on_upgrade(move |socket| status_websocket(socket, state.ping_send.clone(), state.ping_map.clone()))
}