20 lines
414 B
Rust
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,
|
|
)
|
|
}
|