1
0
mirror of https://github.com/actix/actix-website synced 2024-12-04 04:31:55 +01:00
actix-website/examples/url-dispatch/src/dhandler.rs

15 lines
374 B
Rust
Raw Normal View History

2018-05-24 19:13:55 +02:00
// <default>
use actix_web::{http::Method, pred, App, HttpResponse};
fn main() {
App::new()
.default_resource(|r| {
r.method(Method::GET).f(|req| HttpResponse::NotFound());
r.route()
.filter(pred::Not(pred::Get()))
.f(|req| HttpResponse::MethodNotAllowed());
})
.finish();
}
// </default>