felid-cors

1.0.5 • Public • Published

felid-cors

npm version Build Status JavaScript Style Guide

A Felid plugin for CORS.

Install

npm install felid-cors

or

yarn add felid-cors

Usage

const Felid = require('felid')
const cors = require('felid-cors')
 
const app = new Felid()
app.plugin(cors, {
  origin: '*',                          // set the `access-control-allow-origin` header, default is the request `Origin` header.
  allowMethods: ['GET,POST'],           // set the `access-control-allow-methods` header, default is 'GET,HEAD,PUT,POST,DELETE,PATCH'.
  exposeHeaders: ['expose', 'headers'], // set the `access-control-expose-headers` header.
  allowHeaders: ['allow', 'headers'],   // set the `access-control-allow-headers` header.
  maxAge: 3600,                         // set the `access-control-max-age` header, in seconds.
  credentials: true                     // set the `access-control-credentials` header.
})

For details, please check corsen.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i felid-cors

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

239 kB

Total Files

17

Last publish

Collaborators

  • zoron