1.0.2 • Published 6 years ago

@robertoachar/express-cors v1.0.2

Weekly downloads
10
License
MIT
Repository
github
Last release
6 years ago

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