Jul 8, 2024
package.json for a simple projectproducts and reviews
products: Array of 10 objects (each with ID, title, category, price, description)reviews: Array of 5 objects (each with ID, rating, comment, product ID association)package.jsonnpm init -yyarn add json-server or npm install json-serverserve-json in package.json:
"scripts": {
"serve-json": "json-server --watch db.json"
}
yarn serve-json