- Install the following modules:
$ npm init $ npm install express --save $ npm install mongoose --save $ npm install morgan --save $ npm install body-parser --save $ npm install jsonwebtoken --save
- File structure would be like :
- package.json
- config.js
- server.js
- models/user.js
- First comment off the route middleware code
- Then navigate to this route(/api/setup) in postman, then run this route(/api/authenticate) and copy the token.
- Uncomment the route middleware code.
- Now try to access other routes that is defined.
rupachowrasia/node-authentication-jwt
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
NodeJS authentication using JWT
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published