Function ajars_actix_web::actix_web::web::method [−][src]
pub fn method(method: Method) -> Route
Expand description
Create route and add method guard.
use actix_web::{web, http, App, HttpResponse};
let app = App::new().service(
web::resource("/{project_id}")
.route(web::method(http::Method::GET).to(|| HttpResponse::Ok()))
);
In the above example, one GET
route gets added:
- /{project_id}