Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 530 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 530 Bytes

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);