gold Product
app.get("/api/goldrate"); ( we can fetch all the product by this route)
app.post("/api/product") ( we can create product from this route )
{
"name":"diamond",
"weight":"101"
}
input formate
gold price
app.get("/api/goldprice") (fetch price of the gold)
*app.put("/api/goldprice/:id") (can change the gold price by the id who created)
input
{
"goldprice":3101115
}
output
"user": {
"_id": "6467c1bc2a3a5fcb985db736",
"goldprice": 3101115,
"range": [
310111,
310111,
],
"__v": 7
}
here range is how the gold price frequently changes we can show it on grap in front end