mirror of
https://github.com/actix/actix-website
synced 2024-11-27 18:12:57 +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>
|