/node_express_api

simple express api

Primary LanguageJavaScript

This repo follows the youtube tutorial Build a REST API with Node JS and Express | CRUD API Tutorial

To Get Started

  1. npm install
  2. npm run
  3. Open Postman and make a GET request to http://localhost:5000/users
  • You should see an empty array to start
  1. Add a user or users by making a POST request to http://localhost:5000/users in the following format:
  {
    "firstName": "FIRST_NAME",
    "lastName":"LAST_NAME",
    "age":NUMBER
  }
  1. Once users have been added, make another GET request to http://localhost:5000/users, and you should see the users you added.

To get a Single User

Make a GET request to http://localhost:5000/users/INSERTIDHERE

To Delete a User

Make a DELETE Request to http://localhost:5000/users/INSERTIDHERE

To Update a User

Make a PATCH Request to http://localhost:5000/users/INSERTIDHERE with the body that you want to edit. For example:

  {"firstName":"Cherrie"}