×We're offering Women's Scholarships for applicants to our February class! Details here.
Let's rebuild our previous example using a shopping list. The resource we will be working with is
item. We should be using an array to store our items as well as assigning a unique
id to each item so that we can find them easily. Our application should have the following routes:
GET /itemsto show all items in the shopping list
GET /items/newto show a form for creating a new item
GET /items/:idto show a single item
GET /items/:id/editto show a form for editing a item
POST /itemsto create an item when a form is submitted
PATCH /items/:idto edit an item when a form is submitted
DELETE /items/:idto delete an item when a form is submitted
GET /items/searchwhich allows a user to search for items in the shopping list.
DELETE /itemswhich allows a user to remove all the items in the shopping list.
When you're ready, move on to Introduction to MongoDB