2023-04-03 01:47:53 +00:00
|
|
|
use axum::{extract::DefaultBodyLimit, routing::get, routing::post, Router};
|
2023-04-03 01:29:27 +00:00
|
|
|
|
2023-04-03 01:51:09 +00:00
|
|
|
use crate::routes::{health::health_route, index::index_route, liquid::liquid_rescale_route};
|
2023-04-03 01:29:27 +00:00
|
|
|
|
|
|
|
pub fn create_router() -> Router {
|
|
|
|
Router::new()
|
2023-04-03 01:51:09 +00:00
|
|
|
.route("/", get(index_route))
|
2023-04-03 01:47:53 +00:00
|
|
|
.route("/health", get(health_route))
|
2023-04-03 01:29:27 +00:00
|
|
|
.route("/liquid", post(liquid_rescale_route))
|
|
|
|
.layer(DefaultBodyLimit::max(1024 * 10_000 /* 10 MiB */))
|
|
|
|
}
|