Function axum::handler::any[][src]

pub fn any<H, B, T>(handler: H) -> OnMethod<H, B, T, EmptyRouter> where
    H: Handler<B, T>, 
Expand description

Route requests to the given handler regardless of the HTTP method of the request.

Example

use axum::{
    handler::any,
    Router,
};

async fn handler() {}

// All requests to `/` will go to `handler` regardless of the HTTP method.
let app = Router::new().route("/", any(handler));