koa-override
method override middleware for koa
Last updated 6 months ago by fengmk2 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install koa-override 
SYNC missed versions from official npm registry.

koa-override

NPM version npm download CI Coverage

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

Install

npm install koa-override --save

Usage

import bodyParser from 'koa-bodyparser';
import override from 'koa-override';

app.use(bodyParser());
app.use(override());

API

const mw = override([options])

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.

License

MIT

Contributors

Contributors

Made with contributors-img.

Current Tags

  • 4.0.0                                ...           latest (6 months ago)

4 Versions

  • 4.0.0                                ...           6 months ago
  • 3.0.0                                ...           7 years ago
  • 2.0.0                                ...           8 years ago
  • 1.0.0                                ...           10 years ago
Downloads
Total 5
Today 1
This Week 1
This Month 5
Last Day 0
Last Week 4
Last Month 0
Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE