Skip to content

Demo application for Yandex Praktikum students to demonstrate the difference between PUT and PATCH methods in RESTful API.

Notifications You must be signed in to change notification settings

mr9d/put-patch-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Demo application for Yandex Praktikum students to demonstrate the difference between PUT and PATCH methods in RESTful API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published