Hyper Method Override Middleware
A middleware for Hyper that overrides an incoming POST request with a method
given in the request's _method
query paramerter. This is useful as web
browsers typically only support GET and POST requests, but our application may
expect other HTTP methods that are more semantically correct.
The methods PUT, PATCH, and DELETE are accepted for overriding, all others are ignored.
The _method
query paramerter can be specified in a HTML form like so:
Delete item
And the middleware can be applied to our Hyper service like so:
let service = new;
Full example
Here's the example from the Hyper homepage with the middleware applied.
use ;
use ;
use ;
async
async