1
0
mirror of https://github.com/actix/actix-website synced 2024-11-28 10:32:38 +01:00
actix-website/examples/url-dispatch/src/cfg.rs

15 lines
340 B
Rust
Raw Normal View History

2018-05-24 19:13:55 +02:00
// <cfg>
2019-06-17 08:08:42 +02:00
use actix_web::{guard, web, App, HttpResponse};
2018-05-24 19:13:55 +02:00
2019-06-17 08:08:42 +02:00
pub fn main() {
App::new().service(
2019-06-17 10:12:11 +02:00
web::resource("/path").route(
2019-06-17 08:08:42 +02:00
web::route()
.guard(guard::Get())
.guard(guard::Header("content-type", "text/plain"))
.to(|| HttpResponse::Ok()),
),
);
2018-05-24 19:13:55 +02:00
}
// </cfg>