1.0.0 • Published 7 years ago

micro-access v1.0.0

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

micro-access Build Status

Easy CORS handling for micro

Install

$ npm install micro-access

Usage

const {json, send} = require('micro');
const microAccess = require('micro-access');

module.exports = microAccess()(async (req, res) => {
	const body = await json(req);
	send(res, 200, body);
});

API

microAccess(options)(handler)

options

Type: Object

Same as control-access.

handler

Type: Function

The request handler to wrap.

Related

License

MIT © Kevin Mårtensson