Skip to content

tklk/MongoDB-ProductView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MongoDB x RESTful API x Angular

Introduction

A simple implementation of web app product view in mean stack. Check demo @ mean.pv

Installation

Git clone

git clone [email protected]:tklk/MongoDB-ProductView.git
cd MongoDB-ProductView
npm i
make

To config database, add a nodemon.json file in root

{
    "env": {
        "MONGODB_URI": "mongodb+srv://<accName>@<accPwd>.mongodb.net/<dbName>?retryWrites=true&w=majority"
    }
}

Run project

In Development mode:

  • Build and serve client and server:
npm run dev-j
  • Build:
npm run client:dev:build-j
  • Serve:
npm run client:dnp:serve-j

In Production mode:

  • Build and serve client and server:
npm run prod-j
  • Build:
npm run client:prod:build-j
  • Serve:
npm run client:dnp:serve-j

In Development mode:

  • Build and serve client and server:
npm run dev-a
  • Build:
npm run client:dev:build-a
  • Serve:
npm run client:dnp:serve-a

In Production mode:

  • Build and serve client and server:
npm run prod-a
  • Build:
npm run client:prod:build-a
  • Serve:
npm run client:dnp:serve-a

In Development mode:

  • Build and serve client and server:
npm run dev-s
  • Build:
npm run client:dnp:build-s
  • Serve:
npm run client:dev:serve-s

In Production mode:

  • Build and serve client and server:
npm run prod-s
  • Build:
npm run client:dnp:build-s
  • Serve:
npm run client:prod:serve-s

List of RESTful APIs

  • GET /api/list
    • Return a JSON array of products.
  • POST /api/list
    • Return a JSON representation of new product.
  • POST /api/list/:prodId
    • Return a JSON representation of selected-product.
  • PUT /api/list/:prodId
    • Return a JSON representation of updated-product.
  • DELETE /api/list/:prodId
    • Return a JSON representation of deleted-product Id.

License

GPLv3