pub fn build_simple_router<F>(f: F) -> Router where
F: FnOnce(&mut RouterBuilder<'_, (), ()>),
Expand description
Builds a Router
with no middleware using the provided closure. Routes are defined using
the RouterBuilder
value passed to the closure, and the Router
is constructed before
returning.
fn router() -> Router {
build_simple_router(|route| {
route.get("/request/path").to(my_handler);
})
}