Skip to content

oze4/node-api-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node API with JWT : Proof of Concept

Demo

node-jwt-poc-demo.mp4

Synopsis

This project uses MongoDB to store User accounts. Users can register accounts to access protected routes via JWT. We use bcrypt to salt and hash passwords before storing in Mongo.

Important

Authorization header value must start with JWT plus one space, and then the JWT eg:

// header shown as JSON
{
  "authorization": "JWT yourjwt.tokengoes.here"
}

Setup

  • The easiest way to test this project is to install the REST Client vscode extension.
    • Once installed, open the api.rest file at the root of this project
  • You will need to create a .env file based upon the .env.example file

Commands

  • npm install : installs dependencies
  • npm start : starts the project via nodemon

mattoestreich.com