This project shows how you can easily jwt protect your endpoints in web api apps built with node js. It is an easy and simple application. So, it will be suitable for those who are new to coding and those who do not know jwt at all.
Run the following commands in order to start the application.
npm i
node app
"http://localhost:3005/api/auth/login" -> it's public endpoint
1-First, we get a token by sending a request to the login endpoint.
2-Then let's send request to protected end point without token.
As seen when we send request without token we get unauthorized transaction status code
3-Now let's send request to same endpoint with token
We have successfully received our list. You can review project code for more.