npm

Check out our latest tech talk, "JavaScript Supply Chain Security" presented by VP of Security, Adam Baldwin.Watch it here »

micro-access

1.0.0 • Public • Published

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

install

npm i micro-access

Downloadsweekly downloads

8

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability