- Clone down to your device
- In the root directory, run
npm install
to install node modules - Run
nodemon
to see your live server via local host in your browser.
- Uses MongoDB. You can add items to the database via a mock API service, like Swagger
- Routes include
/food
and/clothes
// to create or update an object...
{ "name": "pizza", "calories": "9999", "type": "FRUIT" }
// "name" must be entered as a string, and "calories" as a number.
// "type" includes: 'FRUIT', 'VEG', 'PROTEIN', 'STARTCH', 'SNACK'
// This is how the object appears in the database once an ID is added:
[
{
"_id": "608213af8aa0de435955e12b",
"name": "pizza",
"calories": 9999,
"type": "FRUIT",
"__v": 0
}
]
// Once an item is added, you can update or delete
// it by appending it's unique id to the food route, such as
// `.../food/608213af8aa0de435955e12b`
// to create or update an object...
{ "size": "9", "color": "blue", "type": "SHIRT" }
// "size" must be entered as a number, and "color" as a string.
// "type" includes: 'SHIRT', 'PANTS', 'SHORTS', 'DRESS', 'JACKET'
// This is how the object appears in the database once an ID is added:
[
{
"_id": "608214a88aa0de435955e12e",
"size": 9,
"color": "white",
"type": "SHIRT",
"__v": 0
}
]
// Once an item is added, you can update or delete
// it by appending it's unique id to the clothing route,
// such as `.../clothes/608214a88aa0de435955e12e`
In the command line at the root directory, run npm test
to make sure all test are passing as expected.
├── .gitignore
├── .eslintrc.json
├── __tests__
│ ├── server.test.js
│ ├── logger.test.js
├── src
│ ├── error-handlers
│ │ ├── 404.js
│ │ ├── 500.js
│ ├── middleware
│ │ ├── logger.js
│ │ ├── validator.js
│ ├── models
│ │ ├── food.js
│ │ ├── clothes.js
│ │ ├── data-collection-class.js
│ ├── routes
│ │ ├── food.js
│ │ ├── clothes.js
│ ├── server.js
├── index.js
└── package.json
Thank you to Jarrell Houston for guidance and debugging tips