JSPM

express-cors-options

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q34990F

Create a catch all for responding to CORS OPTIONS method requests

Package Exports

  • express-cors-options

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (express-cors-options) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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));