@infamoustrey/gatekeeper

0.0.4 • Public • Published

gatekeeper

A request Middleware for Express

This middleware package offers a variety of usefull functions to expedite error handeling and app development.

Install & Use

First download into your project and add to your package.json.

$ npm install @infamoustrey/gatekeeper --save

Then import into your express app.

let app = require('express')();
let gatekeeper = require('@infamoustrey/gatekeeper');

// The Require function will throw a 400 response if the required parameters are not met
app.get('/api/foo', gatekeeper.Require(['bar']), (res, req) => {

    res.send('Value of parameter bar: '+req.body.bar);

});

app.listen(3000, () => console.log('App Listening on port: ' + 3000));

Readme

Keywords

none

Package Sidebar

Install

npm i @infamoustrey/gatekeeper

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

1.8 kB

Total Files

3

Last publish

Collaborators

  • infamoustrey