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
356 B
Rust
Raw Normal View History

2018-05-24 19:13:55 +02:00
// <resource>
use actix_web::{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!()
}
pub fn main() {
2018-05-24 19:13:55 +02:00
App::new()
2019-06-17 10:12:11 +02:00
.service(web::resource("/prefix").to(index))
2019-06-17 08:08:42 +02:00
.service(
web::resource("/user/{name}").route(web::get().to(|| HttpResponse::Ok())),
);
2018-05-24 19:13:55 +02:00
}
// </resource>