chicken-sloths / bangazon-api-sprint1

API for a mock Amazon + Etsy platform providing developers access to the company's employee & product data
0 stars 0 forks source link

getSingleProduct & getAllProducts #87

Closed TimAConner closed 6 years ago

TimAConner commented 6 years ago

Description

Add getSingleProduct and getAllProducts functions.

Related Ticket(s)

This deals with two functions of the model part of Issue #54 (Create Product MVC).

Expected Behavior

When you call getSingleProduct(product_id) it will return a single product object. When you call getAllProducts, it will return an array of all products.

Steps to Test Solution

  1. Comment out all routes other than the products route.
  2. In the project folder, run: nodemon app.js
  3. To test get individual product In your browser, access: http://localhost:[YOUR PORT]/api/v1/products/5
  4. To test get all products In your browser, access: http://localhost:[YOUR PORT]/api/v1/products