New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@robertoachar/express-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

@robertoachar/express-cors

Express Cross-Origin Resource Sharing (CORS) middleware.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

express-cors

Generated by Node Project Generator.

NPM Version License

Express Cross-Origin Resource Sharing (CORS) middleware.

This middleware provides the following features:

  • Access-Control-Allow-Origin: *
  • Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE
  • Access-Control-Allow-Headers: Authorization, Content-Type

Usage

  • Install CORS
$ npm i @robertoachar/express-cors
  • Using CORS
const express = require('express');
const cors = require('@robertoachar/express-cors');

const app = express();

app.use(cors());

app.get('/', (req, res) => {
  res.json({ message: 'It works!' });
});

app.listen(3000, () => {
  console.log('Running...');
});

Development

  • Cloning the repo
$ git clone https://github.com/robertoachar/express-cors.git
  • Installing dependencies
$ npm install
  • Running scripts
ActionUsage
Linting codenpm run lint

Author

Roberto Achar

License

MIT

Keywords

node

FAQs

Package last updated on 18 Apr 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