Closed naturallymitchell closed 6 years ago
I've extended the example to show how to match multiple http methods. Specially this part:
App::with_state(AppState{lua: addr.clone()})
// enable logger
.middleware(middleware::Logger::default())
.resource("/{path:.*}", |r| {
r.method(http::Method::GET).with(get);
r.method(http::Method::POST).with(post);
r.method(http::Method::PUT).with(put);
r.method(http::Method::DELETE).with(delete)
})
For more detail about how to extend it. You should check the document of actix-web
.
Is it possible with
actix-web
to handle / filter any method, rather than only on GET requests?So far, I've tried this to
web.lua
and can match any GET request:but I think this line in
main.rs
is too narrow:and it looks like App::filter() would allow more flexibility