[][src]Function actix_web::web::to

pub fn to<F, I, R>(handler: F) -> Route where
    F: Factory<I, R> + 'static,
    I: FromRequest + 'static,
    R: Responder + 'static, 

Create a new route and add handler.

use actix_web::{web, App, HttpResponse};

fn index() -> HttpResponse {
   unimplemented!()
}

App::new().service(
    web::resource("/").route(
        web::to(index))
);