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

pub fn to<F, I, R, P: 'static>(handler: F) -> Route<P> where
    F: Factory<I, R> + 'static,
    I: FromRequest<P> + '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))
);