1.0.0 • Published 5 months ago

@blubox/cors v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

CORS Middleware

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

Installation

npm install @blubox/cors

Usage

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

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

1.0.0

5 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago