mirror of
https://github.com/actix/actix-website
synced 2024-12-04 04:31:55 +01:00
15 lines
374 B
Rust
15 lines
374 B
Rust
|
// <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>
|