mairie360_api_lib 0.4.1

Lib for mairie360 APIs
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::pool::AppState;
use axum::{extract::State, http::StatusCode, response::IntoResponse};
use std::sync::Arc;

pub async fn handle_get(State(state): State<Arc<AppState>>) -> impl IntoResponse {
    match state.redis_pool.get().await {
        Ok(_) => (StatusCode::OK, "Connexion Redis réussie !").into_response(),
        Err(_) => (StatusCode::INTERNAL_SERVER_ERROR, "Échec connexion Redis").into_response(),
    }
}