This is an example Inventory CRUD (Create, Read, Update, Delete) application built with Node.js and Express. It allows you to manage an inventory of items by performing various operations. This application also includes a Jest API test script.
- Create new items and add them to the inventory.
- Read the list of items in the inventory.
- Read details of a specific item.
- Update item details.
- Delete items from the inventory.
Follow these instructions to set up and run the application locally.
- Node.js: Make sure you have Node.js installed. You can download it from nodejs.org.
npm start
The following API endpoints are available:
- Endpoint: POST
/items
- Request Body: JSON with the item's name (
name
).
- Endpoint: GET
/items
- Response: JSON array containing all items in the inventory.
- Endpoint: GET
/items/:id
- Response: JSON object with details of the item with the specified
id
.
- Endpoint: PUT
/items/:id
- Request Body: JSON with the updated item's name (
name
).
- Endpoint: DELETE
/items/:id