1.0.0 • Published 7 years ago

bragg-cors v1.0.0

Weekly downloads
32
License
MIT
Repository
github
Last release
7 years ago

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