add health route
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
use axum::{extract::DefaultBodyLimit, routing::post, Router};
|
||||
use axum::{extract::DefaultBodyLimit, routing::get, routing::post, Router};
|
||||
|
||||
use crate::routes::liquid::liquid_rescale_route;
|
||||
use crate::routes::{health::health_route, liquid::liquid_rescale_route};
|
||||
|
||||
pub fn create_router() -> Router {
|
||||
Router::new()
|
||||
.route("/health", get(health_route))
|
||||
.route("/liquid", post(liquid_rescale_route))
|
||||
.layer(DefaultBodyLimit::max(1024 * 10_000 /* 10 MiB */))
|
||||
}
|
||||
|
9
src/routes/health.rs
Normal file
9
src/routes/health.rs
Normal file
@ -0,0 +1,9 @@
|
||||
use axum::{response::IntoResponse, Json};
|
||||
use serde_json::json;
|
||||
|
||||
pub async fn health_route() -> impl IntoResponse {
|
||||
Json(json!({
|
||||
"ready": true,
|
||||
"reason": "Everything is OK"
|
||||
}))
|
||||
}
|
@ -1 +1,2 @@
|
||||
pub mod health;
|
||||
pub mod liquid;
|
||||
|
Reference in New Issue
Block a user