rust-axum.server-route.mustache Maven / Gradle / Ivy
/// Setup API Server.
pub fn new(api_impl: I) -> Router
where
I: AsRef + Clone + Send + Sync + 'static,
A: Api + 'static,
{
// build our application with a route
Router::new()
{{#pathMethodOps}}
.route("{{{basePathWithoutHost}}}{{{path}}}",
{{#methodOperations}}{{{method}}}({{{operationID}}}::){{^-last}}.{{/-last}}{{/methodOperations}}
)
{{/pathMethodOps}}
.with_state(api_impl)
}