Giter VIP home page Giter VIP logo

node-express-api's Introduction

node-express-api

Get All Users

Request:

  • Method: GET
  • Endpoint: /users
  • Response :
[
    {
        "name": "Mandra",
        "lastName": "Doe",
        "age": 27,
        "id": "cee9999d-00d4-4ed7-b288-c490940785a0"
    },
    {
        "name": "Atun",
        "lastName": "Doe",
        "age": 25,
        "id": "6d54e658-9b14-4938-bc0a-17b45794c7bf"
    }
]

Create User

Request:

  • Method: POST
  • Endpoint: /users

Body :

{
        "name": "Doel",
        "lastName": "Doe",
        "age": 25
}

Response:

[
    {
        "name": "Atun",
        "lastName": "Doe",
        "age": 25,
        "id": "6d54e658-9b14-4938-bc0a-17b45794c7bf"
    },
    {
        "name": "Mandra",
        "lastName": "Doe",
        "age": 25,
        "id": "6a4d16bb-258b-48b6-ba0a-de4ddf2e1dde"
    },
    {
        "name": "Doel",
        "lastName": "Doe",
        "age": 25,
        "id": "a3039b17-9119-4834-beb3-74344ee61dc0"
    }
]

Get User By ID

Request:

  • Method: GET
  • EndPoint: /users/:id
  • response:
{
   "name": "Mandra",
   "lastName": "Doe",
   "age": 27,
   "id": "cee9999d-00d4-4ed7-b288-c490940785a0"
}

Edit User By ID

Request:

  • Method: PATCH
  • EndPoint: /users/:id
  • Body
{
    "name": "doel"
}
  • Response:
[
    {
        "name": "doel",
        "lastName": "Doe",
        "age": 27,
        "id": "cee9999d-00d4-4ed7-b288-c490940785a0"
    },
    {
        "name": "Atun",
        "lastName": "Doe",
        "age": 25,
        "id": "6d54e658-9b14-4938-bc0a-17b45794c7bf"
    }
]

Delete User By ID

Request:

  • Method: DELETE

  • EndPoint : /users/:id

  • Response:

user with the id cee9999d-00d4-4ed7-b288-c490940785a0 succes deleted

node-express-api's People

Contributors

ericksih avatar

Watchers

 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.