Skip to content

SamVerschueren/bragg-cors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

CORS middleware for bragg

Resources

License

Stars

Watchers

Forks

Packages

No packages published