Restful API based on Node.js / express. This project is still in development process. It may contains bugs, be careful to use it.
Showing all the products stored in Database
{
"count": 2,
"products": [
{
"name": "ball",
"price": 50,
"_id": "5bf1d2160752f2098c00041e",
"request": {
"type": "GET",
"url": "http:localhost:3000/products5bf1d2160752f2098c00041e"
}
},
{
"name": "ball",
"price": 50,
"_id": "5bf1d23068ad120ee8b4da9d",
"request": {
"type": "GET",
"url": "http:localhost:3000/products5bf1d23068ad120ee8b4da9d"
}
}
]
}
Adding new product. The payload should contain data like this:
{
"name": "ball",
"price" : "50.00"
}
Updating product. To update the product you must transfer valid data e.g
{
"name": "book",
"price" : "23.00"
}
or only one parameter:
{
"name": "ball"
}
Deleting product. To delete a product you mass pass id:
{
"_id": "5bf1d2160752f2098c00041e"
}
Showing requested product data
{
"_id": "5bf1d2160752f2098c00041e",
"name": "ball",
"price": 50
}