Skip to content

It is a CRUD NodeJS APIs for a typical contact book app with Basic Authentication. It support adding/editing/deleting contacts from a primary storage (MySQL) and allow searching by name and email address.

Notifications You must be signed in to change notification settings

manvendramaan/NodeJS_Contact_Book_Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS Contact Book Application

It is a CRUD NodeJS APIs for a typical contact book app with Basic Authentication. It support adding/editing/deleting contacts from a primary storage (MySQL) and allow searching by name and email address.

Deployed on

How to run :

  1. In MySQL server create database named contacts_app
    CREATE DATABASE contacts_app;
  2. Go to the project path (.../NodeJS_Contact_Book_Application) in cmd and run this command : node app
  3. Open browser and browse this url : http://localhost:4000/
  4. Run the given APIs using Postman or any similar tool.

API List :

Get Token for Basic Authentication :

API URL on Localhost : http://localhost:4000/authenticate
API URL on Heroku : https://glacial-meadow-35240.herokuapp.com/authenticate

Method : POST

Input : {"username":"admin","password":"admin"}

Response :

{
  "status": "success",
  "message": "",
  "totalItems": 1,
  "start": 0,
  "end": 0,
  "items":[
    {
    "message": "User Authenticated!",
    "token": "access_token"
    }
  ]
}

Note : Create your own token <access_token> using this API for Basic Authentication for accessing APIs because the token expires in 24 hrs.


API URL on Localhost : http://localhost:4000/_contact/storeContacts
API URL on Heroku : https://glacial-meadow-35240.herokuapp.com/_contact/storeContacts

Method : POST

Input : {"name":"Manvendra","emailId":"manvendra2215@gmail.com"}

Header : {"access-token":"<access_token>"}


API URL on Localhost : http://localhost:4000/_contact/updateContacts
API URL on Heroku : https://glacial-meadow-35240.herokuapp.com/_contact/updateContacts

Method : POST

Input : {"name":"Manvendra","emailId":"manvendra2215@gmail.com"}

Header : {"access-token":"<access_token>"}


API URL on Localhost : http://localhost:4000/_contact/deleteContacts/11
API URL on Heroku : https://glacial-meadow-35240.herokuapp.com/_contact/deleteContacts/11

Method : DELETE

Header : {"access-token":"<access_token>"}


API URL on Localhost : http://localhost:4000/_contact/searchContacts
API URL on Heroku : https://glacial-meadow-35240.herokuapp.com/_contact/searchContacts

Method : POST

Input : {"keyword":"manvendra","limit":"10","offset":"0"}

Header : {"access-token":"<access_token>"}

Note : By Default limit is 10 and offset is 0


For Test Case :

  1. Go to the project path (.../NodeJS_Contact_Book_Application/test) in cmd and run this command : npm test

About

It is a CRUD NodeJS APIs for a typical contact book app with Basic Authentication. It support adding/editing/deleting contacts from a primary storage (MySQL) and allow searching by name and email address.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published