This is an E-commerce API made using Node.Js & MongoDB.
STEPS TO USE THE API:
- Run "npm install"
- Start the server using npm start
- Open postman
- Make a GET request on localhost:3000/products
- The products should be visible
- Start the server using
node app.js
. - Open Postman.
- Set the request method to POST.
- Enter
localhost:3000/products/create
as the URL. - Select the 'Body' tab below the URL field.
- Choose 'x-www-form-urlencoded' from the dropdown menu.
- Add 'name' and 'quantity' as keys with desired values.
- Send the request.
- If you receive a message confirming successful product addition, you have completed the process.
- To verify, make a GET request to localhost:3000/products.
- Copy the object ID of the product you wish to delete.
- Append the ID to
localhost:3000/products/
. - For Example:
localhost:3000/products/65e742f70518faf32899af12
. - Send a DELETE request.
- Upon successful deletion, you'll receive a confirmation message.
- Copy the object ID of the product whose quantity you want to update.
- Append the ID to
localhost:3000/products/
. - For example, the URL should look like
localhost:3000/products/65e742f70518faf32899af12
. - Select the 'Body' tab below the URL field.
- Choose 'x-www-form-urlencoded' from the dropdown menu.
- In the key field, write 'quantity' and the updated value.
- Send a POST request.
- You should receive a message containing the updated product details.