1.0.0 • Published 5 months ago

api-guard-with-jwt v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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.

1.0.0

5 months ago