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

16 lines
384 B
Rust
Raw Normal View History

2018-05-24 19:13:55 +02:00
// <resource>
2019-06-17 08:08:42 +02:00
use actix_web::{http::Method, web, App, HttpRequest, HttpResponse};
2018-05-24 19:13:55 +02:00
2019-06-17 08:08:42 +02:00
fn index(_req: HttpRequest) -> HttpResponse {
2018-05-24 19:13:55 +02:00
unimplemented!()
}
fn main() {
App::new()
2019-06-17 08:08:42 +02:00
.service(web::resource("/prefix").route(web::get().to(index)))
.service(
web::resource("/user/{name}").route(web::get().to(|| HttpResponse::Ok())),
);
2018-05-24 19:13:55 +02:00
}
// </resource>