☑Kizspy.me
Requirements:
- Copy the file "database.json" in the given folder to your exam.
- Open two Terminal Command windows on your exam to execute commands:
о
о
json-server-watch database.json-port 9999 (0 points if not running json-server)
npm start
Question 1 (4 marks) - Fetch and Display Products
Create a component that retrieves and displays all products from the API endpoint:
GET
http://localhost: 9999/products
Requirements:
.
Component is routed at URL:
http://localhost:3000 (0 points if incorrect the URL)
•
Design the correct layout.
.
Display the Title, Category, Price, and Rate (average rating of reviews) in a table.
Include a dropdown list box to filter products by category, with categories returned
from the API.
Figure 1: Fetch and display products
+ 78%
Zoom
Close