Code Monkey home page Code Monkey logo

ecommerce_api's Introduction

E-Commerce-API

ABOUT

This is an E-commerce API made using Node.Js & MongoDB.

STEPS TO USE THE API:

  1. Run "npm install"
  2. Start the server using npm start
  3. Open postman
  4. Make a GET request on localhost:3000/products
  5. The products should be visible

Steps to Use the API:

Steps to Create a New Product:

  1. Start the server using node app.js.
  2. Open Postman.
  3. Set the request method to POST.
  4. Enter localhost:3000/products/create as the URL.
  5. Select the 'Body' tab below the URL field.
  6. Choose 'x-www-form-urlencoded' from the dropdown menu.
  7. Add 'name' and 'quantity' as keys with desired values.
  8. Send the request.
  9. If you receive a message confirming successful product addition, you have completed the process.
  10. To verify, make a GET request to localhost:3000/products.

Steps to Delete a Product:

  1. Copy the object ID of the product you wish to delete.
  2. Append the ID to localhost:3000/products/.
  3. For Example: localhost:3000/products/65e742f70518faf32899af12.
  4. Send a DELETE request.
  5. Upon successful deletion, you'll receive a confirmation message.

Steps to Update the Quantity of a Product:

  1. Copy the object ID of the product whose quantity you want to update.
  2. Append the ID to localhost:3000/products/.
  3. For example, the URL should look like localhost:3000/products/65e742f70518faf32899af12.
  4. Select the 'Body' tab below the URL field.
  5. Choose 'x-www-form-urlencoded' from the dropdown menu.
  6. In the key field, write 'quantity' and the updated value.
  7. Send a POST request.
  8. You should receive a message containing the updated product details.

ecommerce_api's People

Contributors

sushant-14 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.