Name: koa-override
Owner: node_modules
Description: method override middleware for koa
Created: 2015-02-09 09:07:01.0
Updated: 2018-01-25 02:12:15.0
Pushed: 2017-11-08 09:06:11.0
Homepage: null
Size: 12
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Method override middleware. Let you use HTTP verbs such as PUT or DELETE in places where the client doesn't support it.
Refactor from koa-override-method#5
m install koa-override --save
t bodyParser = require('koa-bodyparser')
t override = require('koa-override')
use(bodyParser())
use(override())
If body
exists, check body._method
first.
Otherwise check X-HTTP-Method-Override
header.
If there is no override parameter, then it's simply this.request.method
.
You shouldn't use this unless you know you're using override.
options.allowedMethods = [ 'POST' ]
Only allowed override method on POST
request.