node-modules/koa-override

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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
m install koa-override --save
Usage
t bodyParser = require('koa-bodyparser')
t override = require('koa-override')

use(bodyParser())
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.

License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.