I have a JSON object that contains an array of reviews for a product, and I’m trying to access only the reviews part of the object using JSON Server. I tried making a GET request to http://localhost:3000/products/1/reviews
(where 1 is the ID of the product), but I’m getting a 404 error.
{
"id": 1,
"name": "Product A",
"description": "This is a great product.",
"reviews": [
{
"id": 1,
"rating": 4,
"comment": "I really like this product."
},
{
"id": 2,
"rating": 5,
"comment": "This product exceeded my expectations!"
},
{
"id": 3,
"rating": 3,
"comment": "This product is okay, but I've had better."
}
]
}