pub fn to<F, Args>(handler: F) -> Route
Expand description
Creates a new any-method route with handler.
use actix_web::{web, App, HttpResponse, Responder};
async fn index() -> impl Responder {
HttpResponse::Ok()
}
App::new().service(
web::resource("/").route(
web::to(index))
);