Skip to content

Latest commit

 

History

History
56 lines (34 loc) · 1.31 KB

README.md

File metadata and controls

56 lines (34 loc) · 1.31 KB

PUT/PATCH demo for Yandex Praktikum

About

Demo application developed at the request of Yandex Praktikum students. The goal was to demonstrate the difference between PUT and PATCH methods in RESTful API.

Running application

If you want to run the application, you can do the following:

  • git clone the repository
  • Run npm install
  • Start application with npm run start

After this, REST API should be available for calls from Insomnia or Postman at http://localhost:8080

How to use

GET /contacts

Returns a list of all contact.

GET /contacts/:phone

Returns one contact for provided phone number.

POST /contacts

Creates a new contact. Expects the following JSON body:

{
  "firstName" = "...",
  "lastName": "...",
  "phone": "..."
}

PUT /contacts/:phone

Replaces contact with provided phone number.

The request body is the same as above.

PATCH /contacts/:phone

Modifies contact with provided phone number.

The request body is the same as above, but all fields are optional.

Used technologies