GithubHelp home page GithubHelp logo

nodejs-restfull-application's Introduction

nodejs-restfull-application

Simple RESTFULL CRUD services developed with nodejs

Steps to run the project

  1. Download/Clone The Project

  2. Go to the project folder

  3. Run following commands to run the application

    npm install
    
    npm index
    

    or

    noidemon index
    

Create Contact Service

Request Type - POST Request URL :

http://localhost:8080/api/contacts

Request Body :

{
	"name": "Bhupesh Singh",
	"email": "[email protected]",
	"gende": "male",
	"phone": "1234567890"
}

Response -

{
    "message": "New contact created!",
    "data": {
        "_id": "5c60fa2f33bd0439ee89bff9",
        "create_date": "2019-02-11T04:29:35.691Z",
        "name": "Bhupesh Singh",
        "email": "[email protected]",
        "phone": "1234567890",
        "__v": 0
    }
}

Read Contact By Id Service

Request Type - GET Request URL :

http://localhost:8080/api/contacts/5c60fa2f33bd0439ee89bff9

Response:

{
    "message": "Contact details loading..",
    "data": {
        "_id": "5c60fa2f33bd0439ee89bff9",
        "create_date": "2019-02-11T04:29:35.691Z",
        "name": "Bhupesh Singh",
        "email": "[email protected]",
        "phone": "1234567890",
        "__v": 0
      }
}

Read All Contacts Service

Request Type - GET Request URL :

http://localhost:8080/api/contcats

Response:

{
    "status": "success",
    "message": "Contacts retrieved successfully",
    "data": [
        {
            "_id": "5c60f3949b233f37d9803266",
            "create_date": "2019-02-11T04:01:24.953Z",
            "name": "Bhupesh Singh Padiyar",
            "gender": "MALE",
            "email": "[email protected]",
            "phone": "1234567890",
            "__v": 0
        },
        {
            "_id": "5c60fa2f33bd0439ee89bff9",
            "create_date": "2019-02-11T04:29:35.691Z",
            "name": "Bhupesh Singh",
            "email": "[email protected]",
            "phone": "1234567890",
            "__v": 0
        }
    ]
}

Delete a Contact Service

Request Type - DELETE Request URL :

http://localhost:8080/api/contacts/5c60f3949b233f37d9803266

Response:

{
    "status": "success",
    "message": "Contact deleted"
}

Update Contact Service

Request Type - PUT Request URL :

http://localhost:8080/api/contacts/5c60f3e09b233f37d9803267

Request:

{
	"name": "Bhupesh Singh Padiyar",
	"email": "[email protected]",
	"gende": "male",
	"phone": "0123456789"
}

Response:

{
    "message": "Contact Info updated",
    "data": {
        "_id": "5c60f3e09b233f37d9803267",
        "create_date": "2019-02-11T04:02:40.431Z",
        "name": "Bhupesh Singh Padiyar",
        "email": "[email protected]",
        "phone": "0123456789",
        "__v": 0
    }
}

nodejs-restfull-application's People

Contributors

bhupeshpadiyar 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.