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 init" command on terminal in this projects directory
  2. start the server using node app.js
  3. Open postman
  4. Make a GET request on localhost:3000/products
  5. The products should be visible

STEPS TO CREATE A NEW PRODUCT:

  1. start the server using node app.js
  2. Open postman
  3. put localhost:3000/products/create as the url.
  4. Select Body tab below the url textarea and then select x-www-form-urlencoded
  5. Add name & quantity as the keys and set the desired values for the keys.
  6. Make a POST request.
  7. If you recieve the message saying new product added successfully then you have done everything correct.
  8. The product is created. Check it out by making a GET request at localhost:3000/products

STEPS TO DELETE A PRODUCT:

  1. copy the object id of the product you want to delete.
  2. add the id after localhost:3000/products/
  3. Make a DELETE request.
  4. You will recieve a message saying deleted successfully.

STEPS TO UPDATE THE QUANTITY OF A PRODUCT:

  1. Copy the object id of the product whose quantity you want to update
  2. Put the id after localhost:3000/products/
  3. After putting the id add /update_quantity/?number={x} in the url where x is the number by which you want to increase or decrease the quantity.
  4. the url should be looking like localhost:3000/products/{id}/update_quantity/?number={x}
  5. Make a POST request and you should get a message containing the update product

TECHSTACK

Node.Js, MongoDB

ecommerce-api's People

Contributors

suryasmaty 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.