Skip to content

lixx21/NodeJS-login-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

You can check the explanation in my medium HERE

Tech Stack

  • MongoDb
  • Node.JS
  • Express.JS

Routes

  • POST /login: to login and get the user's token
    request json: {
        "email": "felixpratama12@gmail.com",
        "password": "filedeck1"
    }
  • GET /authenticate: to authenticate your jwt token. To use this you need to input the token in bearer authorization
  • POST /register: to register your account to database (MongoDB)
    request json: {
        "username":"your username",
        "email":"your email",
        "password":"your password"
    }
  • GET findUser/: change <email> with your email address

How to use

  • clone this repository
  • install all packeges npm install
  • run node app.js