Giter Site home page Giter Site logo

manvendramaan / nodejs_contact_book_application Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.81 MB

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.

Home Page: https://glacial-meadow-35240.herokuapp.com/

JavaScript 100.00%
nodejs crud-application crud-operation rest-api restful-webservices mysql nodejs-authentication

nodejs_contact_book_application's Introduction

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":"[email protected]"}

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":"[email protected]"}

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

nodejs_contact_book_application's People

Contributors

manvendramaan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.