New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cors-expressjs

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

cors-expressjs

Cors middleware for Express framework

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cors-expressjs

Cors middleware for Express framework

Build Status Coverage Status

Class based middleware for CORS support for APIs. Based on article HTTP access control (CORS)

Installation

Install Cors as an npm module and save it to your package.json file as a dependency:

npm install --save cors-expressjs

Basic Usage

To start using this middleware you need to create an instance of Cors class. Then you can use middleWare method. Here is example:

    'use strict';
    const express = require('express');
    const Cors = require('cors-expressjs');
    const app = express();
    const cors = new Cors();

    app.use(cors.middleWare());
    app.get('/', (req, res) => res.json({ success: true }));

    app.listen(3000);

That's it. Very simple :)

Tests

npm test

Keywords

FAQs

Package last updated on 14 Aug 2017

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