- Install node https://nodejs.org/en/download/
- Install mongo db https://docs.mongodb.com/manual/installation/
- go to the data folder inside of the project
- mongoimport --headerline --type csv --db ecomm --collection products --file products.csv
- mongoimport —headerline --type csv --db ecomm --collection inventory --file inventory.csv
- git clone https://github.com/Timfrazer/bonobos.git
- inside the folder type npm install
- Start the mongo server type mongod
- start node type npm start
Server is now running....
let's test out the API Test the API via CURL use any product id may I sugest the number 1
- GET a product - curl localhost:3000/product/1
- GET all products - curl localhost:3000/product
- GET the inventory for a product - curl localhost:3000/inventory/1
- GET all inventory - curl localhost:3000/inventory
- GET product & inventory - curl localhost:3000/productinventory/1