Launch Week Day 3: Introducing Organization Notifications in Socket.Learn More →
Socket
Book a DemoSign in
Socket

koa-override

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-override

method override middleware for koa

Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
27K
-0.54%
Maintainers
4
Weekly downloads
 
Created
Source

koa-override

NPM version build status Test coverage David deps npm download

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

const bodyParser = require('koa-bodyparser')
const override = require('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

Keywords

koa-override

FAQs

Package last updated on 08 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts