simple-cors

2.0.1 • Public • Published

simple-cors

Simple module to add Cross-Origin Resource Sharing headers to your routes.

This module will add the following (very open CORS headers) to your response.

Access-Control-Allow-Origin: '*'
Access-Control-Allow-Methods: 'GET,PUT,POST,DELETE,OPTIONS'
Access-Control-Allow-Headers: request.headers['access-control-request-headers']

and will respond with 200 OK to any OPTIONS request

Install

npm install simple-cors

Usage

var corsRoute = require('simple-cors');

routes['/api/test'] = corsRoute(function(request, response){
    response.end('Hello CORS World!');
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.1
    32
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.1
    32
  • 2.0.0
    1
  • 1.1.1
    0
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i simple-cors

Weekly Downloads

33

Version

2.0.1

License

MIT

Unpacked Size

5.77 kB

Total Files

5

Last publish

Collaborators

  • mauricebutler