1.0.5 • Published 4 years ago

felid-cors v1.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago