Skip to content

kevva/micro-access

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Easy CORS handling for micro

Resources

License

Stars

Watchers

Forks

Packages

No packages published