Files
nuchat/backend/src/routes/mod.rs
2025-07-16 16:43:24 +01:00

20 lines
414 B
Rust

use axum::Router;
use axum::routing::{get, post};
use std::sync::mpsc;
mod healthcheck;
mod shutdown;
use healthcheck::healthcheck;
use shutdown::shutdown;
pub fn app() -> (Router, mpsc::Receiver<bool>) {
let (tx, rx) = mpsc::channel();
(
Router::new()
.route("/healthcheck", get(healthcheck))
.route("/shutdown", post(move || shutdown(tx.clone()))),
rx,
)
}