0.0.1 • Published 4 years ago

@skuyjs/http-plugin-cors v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

http-plugin-cors

Cross-Origin Resource Sharing plugin for SkuyJS

Basic Usage

Installation

npm install @skuyjs/http-plugin-cors

Usage

const Server = require('@skuyjs/http-server');

const cors = require('.')({
  'Access-Control-Allow-Origin': ['localhost'],
  'Access-Control-Allow-Headers': ['Content-Type'],
  'Access-Control-Allow-Methods': ['GET', 'POST'],
});

const app = new Server();

app.use(cors.build());

app.get('/', (req, res) => {
  res.send('hore');
});

app.listen(8080);
0.0.1

4 years ago