Function axum::handler::get[][src]

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

Route GET requests to the given handler.

Example

use axum::prelude::*;

async fn handler() {}

// Requests to `GET /` will go to `handler`.
let app = route("/", get(handler));