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

pub fn any<H, B, T>(handler: H) -> OnMethod<IntoService<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::prelude::*;

async fn handler() {}

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