0.0.3 • Published 2 years ago

@shise/cors v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

CORS Middleware

A middleware for handling Cross-Origin Resource Sharing (CORS) in your web server.

Installation

npm install @shise/cors

Usage

const cors, { CorsOptions } = require('@shise/cors')
const { Controller } = require('shise')

const controller = new Controller()
controller.use(cors(/* optional CorsOptions */))

Options

allowedOrigins (optional): Array of allowed origins. Default is an empty array. allowedMethods (optional): Array of allowed HTTP methods. Default is 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'. allowedHeaders (optional): Array of allowed headers. Default is an empty array. exposedHeaders (optional): Array of headers exposed to the client. Default is an empty array. maxAge (optional): The maximum time (in seconds) that a preflight request may be cached. Default is 600. credentials (optional): Boolean indicating whether credentials (e.g., cookies) should be included. Default is false.

License

MIT

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago