api-guard-with-jwt
v1.0.0
Published
A middleware to verify your nodejs express api with jwt token
Downloads
2
Readme
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
License
This project is licensed under the MIT license. See the LICENSE file for more info.