/Jwt-Middleware-NodeJs-API

This project shows how you can easily jwt protect your endpoints in web api apps built with node js.

Primary LanguageJavaScriptMIT LicenseMIT

JWT Protected NodeJs API

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.

Installation

Run the following commands in order to start the application.

npm i
node app

About application

"http://localhost:3005/api/auth/login" -> it's public endpoint 1-First, we get a token by sending a request to the login endpoint. jwt1

2-Then let's send request to protected end point without token. jwt2 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 jwt3

We have successfully received our list. You can review project code for more.