Expand description
§Named Routes Axum is a crate that allows you to name your axum routes
use named_routes_axum::{RouterWrapper, NamedRoutesService};
let app = axum::Router::<()>::new();
let my_named_routes = RouterWrapper::new().get("/hello", || async { "Hello world" }, "index-page");
app.merge(my_named_routes.into_router()); // then get the actual axum router built
// using an instance of the `NamedRoutesService` you can redirect or get the route path
let path = NamedRoutesService::new().get("index-page").unwrap().redirector().path();
Modules§
Structs§
- Named
Routes Service - Parts
Value - Route
Path - Router
Wrapper - Axum Router Wrapper Instead of using Axum’s default Router to register routes this type should be used