api-guard-with-jwt

1.0.0 • Public • Published

api-guard-with-jwt

A middleware to verify your nodejs express api with jwt token

Install

$ npm install api-guard-with-jwt

Usage

const guard = require('api-guard-with-jwt')

Method-1

Use Globally

app.use(guard.verify('shhhhh'))
app.use('/users', usersRouter);

Method-2

Use Single

router.get('/',[guard.verify('shhhhh')], async function(req, res, next) {});

Note: here 'shhhh' is a token secrect key

Acknowledgments

  • jsonwebtoken

Author

Siraj Khan

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Readme

Keywords

none

Package Sidebar

Install

npm i api-guard-with-jwt

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.73 kB

Total Files

5

Last publish

Collaborators

  • sirajkhan01