mirror of
https://github.com/actix/actix-website
synced 2024-11-28 10:32:38 +01:00
16 lines
357 B
Rust
16 lines
357 B
Rust
|
// <cfg>
|
||
|
use actix_web::{pred, App, HttpResponse};
|
||
|
|
||
|
fn main() {
|
||
|
App::new()
|
||
|
.resource("/path", |resource| {
|
||
|
resource
|
||
|
.route()
|
||
|
.filter(pred::Get())
|
||
|
.filter(pred::Header("content-type", "text/plain"))
|
||
|
.f(|req| HttpResponse::Ok())
|
||
|
})
|
||
|
.finish();
|
||
|
}
|
||
|
// </cfg>
|