Skip to content

It validates the user data for registration and login using joi validation and lets user access the home route if they are logedIn with a verified token generated by json wen token.

payalpatra/Nodejs-API-Auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodejs-API-Auth

Overview

This validates the user data for registration and login using joi validation and lets user access the home route if they are logedIn with a verified token generated by json wen token.

This API has 3 routes :-

  • /api/user/home
  • /api/user/register
  • /api/user/login

Setup Guidlines

STEP 1

git clone https://github.com/payalpatra/Nodejs-API-Auth.git

STEP 2

(Make sure to run this in the root directory)
  npm install

STEP 3

(Create .env file in the root directory with the following Variable)
 DB_CONNECT =mongodb+srv://<USERNAME>:<PASSWORD>@cluster0.ifcel.mongodb.net/<DBNAME>?retryWrites=true&w=majority
 TOKEN_SECRET= thisIsTheToken
  • Starting the server
(Make sure to run this in the root directory)
 nodemon index

About

It validates the user data for registration and login using joi validation and lets user access the home route if they are logedIn with a verified token generated by json wen token.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published