express-cors-options

0.0.4 • Public • Published

Express CORS OPTIONS

Create a catch all for responding to CORS OPTIONS method requests


Installation

npm install express-cors-options

Usage:

// Place after router
app.use(app.router);
 
//
var options = {
    origin: 'http://foo.com', // default: '*'
    method: 'GET,PUT,POST', // default: 'GET,PUT,POST,DELETE,HEAD,OPTIONS'
    headers: 'Content-Type, Content-Length' // default: 'Content-Type, Authorization, Content-Length, X-Requested-With, X-HTTP-Method-Override'
};
 
app.use(require('express-cors-options')(options));

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    1
  • 0.0.3
    0
  • 0.0.2
    1
  • 0.0.1
    0

Package Sidebar

Install

npm i express-cors-options

Weekly Downloads

2

Version

0.0.4

License

none

Last publish

Collaborators

  • jmerrick