Skip to content

ilan7empest/Nodejs-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boilerplate nodejs api with jwt authentication

1. Clone repository

2. Add .env file in root directory with the following key=value

PORT = localhost port
MONGODB_URI = Conenction string to Mongodb 
JWT_SECRET = some secret text

3. Use the following end points in postman

POST Request "domain/signup" with an email and password json passed in the body
POST Request "domain//login" with the same email and password = returns jwt token to use in all following request

4. Use "passport.authenticate("jwt", { session: false })" as a middleware for all authorized routes

5. pass the token in the "Authentication" header

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published