Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dkx/http-middleware-cors

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dkx/http-middleware-cors

CORS middleware for @dkx/http-server

  • 0.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

DKX/Http/Middleware/Cors

CORS middleware for @dkx/http-server.

Installation

$ npm install --save @dkx/http-middleware-cors

or with yarn

$ yarn add @dkx/http-middleware-cors

Usage

const {Server} = require('@dkx/http-server');
const {corsMiddleware} = require('@dkx/http-middleware-cors');

const app = new Server;
const corsOptions = {
	domains: ['*']
};

app.use(corsMiddleware(corsOptions));

Options

  • domains:
    • Required
    • Array of allowed domains
    • If there is only one item and it is *, all incoming requests will be allowed
  • methods:
    • Optional
    • Array of allowed methods
    • Sets the access-control-allow-methods HTTP header
  • headers:
    • Optional
    • Array of allowed headers
    • Sets the access-control-allow-headers HTTP header
  • maxAge:
    • Optional
    • Number
    • Sets the access-control-max-age HTTP header
  • credentials:
    • Optional
    • Boolean
    • Sets the access-control-allow-credentials HTTP header

FAQs

Package last updated on 18 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc