Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koa-methodoverride

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-methodoverride

HTTP method override for koa

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
870
increased by24.29%
Maintainers
1
Weekly downloads
 
Created
Source

Method Override Build Status

HTTP method override for koa.

Install

npm install koa-methodoverride

Usage

var app = require('koa')();
var parse = require('co-body');
var methodOverride = require('koa-methodoverride');

// First, must parse the body, use the `co-body` or the `koa-bodyparser` etc.
app.use(function *(next) {
  try {
    this.request.body = yield parse(this);
  } catch (e) {
    this.request.body = null;
  }
  yield next;
});

var key = '_method'; // default
app.use(methodOverride(key));

app.listen(3000);

Dependencies

  • co-body
  • Or other body parser

License

MIT

Keywords

FAQs

Package last updated on 24 Mar 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc