https://github.com/mr9d/put-patch-demo
Demo application for Yandex Praktikum students to demonstrate the difference between PUT and PATCH methods in RESTful API.
https://github.com/mr9d/put-patch-demo
express insomnia patch postman practicum praktikum put rest yandex
Last synced: about 1 month ago
JSON representation
Demo application for Yandex Praktikum students to demonstrate the difference between PUT and PATCH methods in RESTful API.
- Host: GitHub
- URL: https://github.com/mr9d/put-patch-demo
- Owner: mr9d
- Created: 2020-08-24T18:13:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-11-14T18:29:52.000Z (over 3 years ago)
- Last Synced: 2025-05-21T20:12:14.469Z (about 1 year ago)
- Topics: express, insomnia, patch, postman, practicum, praktikum, put, rest, yandex
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PUT/PATCH demo for Yandex Praktikum
## About
Demo application developed at the request of [Yandex Praktikum](https://practicum.com/) 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](https://insomnia.rest/) or [Postman](https://www.postman.com/) at
## 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
- Express 4.17 ([documentation](https://expressjs.com/en/4x/api.html))
- [Insomnia](https://insomnia.rest/)
- [Postman](https://www.postman.com/)
- Read more about [RESTful APIs](https://restfulapi.net/)