bragg-cors

1.0.0 • Public • Published

bragg-cors Build Status

CORS middleware for bragg

Install

$ npm install --save bragg-cors

Usage

const bragg = require('bragg');
const cors = require('bragg-cors');

const app = bragg();

app.use(ctx => {
	ctx.body = {
		unicorn: '🦄'
	};
});

app.use(cors('https://www.foo.io'));

exports.handler = app.listen();

API

cors(origin)

origin

Type: string

A URI that may access the resource.

License

MIT © Sam Verschueren

Package Sidebar

Install

npm i bragg-cors

Weekly Downloads

320

Version

1.0.0

License

MIT

Last publish

Collaborators

  • samverschueren