Skip to content

contactjittu/hapiapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hapiapp

This app includes:

  1. Signup
  2. Login
  3. Forgot Password
  4. Reset Password

In this app JWT JSON WebToken is used for User Authentication (Node.js using Hapijs), Joi for user input validation, mongoose for ORM, Nodemailer for sending an email to user, Winston for error logging, Boom for returning error response object.

Installation

npm install

Setup

Create .env file on root directory and add the below code

SECRET = AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q
PORT = 8000
MONGO_URI = mongodb://localhost:27017/hapiapp
NODE_ENV = development
EMAIL_ID = [email protected]
EMAIL_PWD = example

Start an app

npm start

API Available

Signup User
POST: http://localhost:8000/auth/signup

{
	"firstname": "Jitendra",
	"lastname": "Kumar",
	"email": "[email protected]",
	"password": "123"
}
Login User
POST: http://localhost:8000/auth/login

{
	"email": "[email protected]",
	"password": "123"
}
Forgot password
POST: http://localhost:8000/auth/forgot

{
	"email":"[email protected]"
}
Reset password - You will get token on email address
POST: http://localhost:8000/auth/resetpassword/{token}

{
 	"password": 123
}

My other project

[Express app] (https://github.com/contactjittu/expressapp)