1.0.0 • Published 2 years ago
api-guard-with-jwt v1.0.0
api-guard-with-jwt
A middleware to verify your nodejs express api with jwt token
Install
$ npm install api-guard-with-jwtUsage
const guard = require('api-guard-with-jwt')Method-1
Use Globallyapp.use(guard.verify('shhhhh')) app.use('/users', usersRouter);Method-2
Use Singlerouter.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.
1.0.0
2 years ago