Demonstrating authentication by verifying a token using Express route middleware.
- node, npm, express and mongoose
- Clone the repo
- Install dependencies:
- Change SECRET in
- Add your own MongoDB database to
- Start the server:
- Create sample user by visiting:
Once everything is set up, we can begin to use our app by creating and verifying tokens.
Getting a Token
POST request to
Verifying a Token and Listing Users
You can also send the token as a URL parameter: