1
0
mirror of https://github.com/actix/actix-website synced 2024-12-02 19:52:23 +01:00
actix-website/examples/url-dispatch/src/resource.rs
2018-07-21 05:21:41 -07:00

17 lines
369 B
Rust

// <resource>
use actix_web::{http::Method, App, HttpRequest, HttpResponse};
fn index(req: &HttpRequest) -> HttpResponse {
unimplemented!()
}
fn main() {
App::new()
.resource("/prefix", |r| r.f(index))
.resource("/user/{name}", |r| {
r.method(Method::GET).f(|req| HttpResponse::Ok())
})
.finish();
}
// </resource>