swap backend to rust
This commit is contained in:
19
backend/src/routes/mod.rs
Normal file
19
backend/src/routes/mod.rs
Normal file
@ -0,0 +1,19 @@
|
||||
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,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user