Function on_service
fn on_service<T, S>(filter: crate::routing::MethodFilter, svc: T) -> MethodRouter<S, <T as >::Error>
where
T: Service<axum_core::extract::Request> + Clone + Send + Sync + 'static,
<T as >::Response: IntoResponse + 'static,
<T as >::Future: Send + 'static,
S: Clone
Route requests with the given method to the service.
Example
use ;
use Response;
use Infallible;
let service = service_fn;
// Requests to `POST /` will go to `service`.
let app = new.route;
# let _: Router = app;