To use this repository, you need the following installed locally:
- Clone the repository and navigate to the directory
https://github.com/rolling-scopes-school/parfenenkovedit-ST2021Q1.git
cd things-mongo
- Install dependencies
npm i
-
Create access.log and .env configuration file
-
Run one of the commands below
Development server
npm run dev
Production build
npm run start
node index.js
GET api/v2/things -> list of all things
GET api/v2/things/:id -> select an existing thing
POST api/v2/things -> create a new thing
PUT api/v2/things/:id -> update an existing thing by its own id
DELETE api/v2/things/:id -> delete an existing thing by its own id
Your request should include:
- title (required) - string value
- body (optional, null by default) - an array of property objects. Each object should contain key and value fields
Example:
{
"title": "Some title",
"body": [
{
"key": "key for value",
"value": "value for the key"
},
{
"key": "another key for value",
"value": "another value for the key"
}
]
}