Giter Site home page Giter Site logo

nodejs-mongo-sample's Introduction

Products && Categories REST API'S

#Running app in local

  1. Open configs/mongo-config.js and change mongo url with your mongodb credentials and make sure mongodb is running.

  2. Navigate to application folder in terminal and run "npm install".

  3. Navigate to application folder in terminal and run "node app.js".

  4. Now the application will be running on port 3200.

#Running app through Docker

  1. Install Docker on your system.

  2. Navigate to application folder in terminal and run "docker-compose up -d".

  3. Run the command "docker ps" to check whether mongo and app services are running.

  4. If the two docker services are up , Now the application is running on port 3200.

#Endpoint of Application

  1. "/addcategory" -- Post API to add categories. Required body params -- categoryname

  2. "/addsubcategory/:id" -- Put API to add child categories(id of category). Required body params -- categoryname

  3. "/categories" -- Get API to get all categories and its child categories.

  4. "/addproduct" -- Post API to add products. Requiered body params -- title -- description -- imagepath -- size -- color -- quantity -- price -- category (if only 1 category)(should post id of category) -- category (to add multiple categories send category param multiple times with different values). Note : Should post id of category in category field.

  5. "/updateproductdetails/:id" -- Put API to update productdetails.(id of product) Requiered body params -- title -- description -- imagepath -- size -- color -- quantity -- price (any one param is required)

  6. "/products" -- Get API to get all products and its details.

  7. "/products/:id" -- Get API to get single product details of id.

  8. "/productsbycat/:id" -- Get API to get products based on categories (id of category).

#API's Host for Docker and local

host = http://localhost:3200

Example API : http://localhost:3200/products

nodejs-mongo-sample's People

Contributors

chetan1642 avatar

Watchers

James Cloos avatar  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.