rsiot/components/cmp_http_server/routes/
root.rs

1use axum::{extract, response::Html};
2
3use crate::{components_config::http_server::handler_info, message::MsgDataBound};
4
5use super::super::shared_state::SharedState;
6
7/// Маршрут для получения сообщений
8pub async fn root<TMsg>(
9    extract::State(shared_state): extract::State<SharedState<TMsg>>,
10) -> Html<String>
11where
12    TMsg: MsgDataBound,
13{
14    let get_endpoints = shared_state.get_endpoints.lock().await;
15    let put_endpoints = shared_state.put_endpoints.lock().await;
16    let body = handler_info(&get_endpoints, &put_endpoints);
17    Html(body)
18}