- Start a
mongod
process - Install project dependencies
npm install
- Fill DB with data:
npm run seed
- Start API server
npm start
To price a basket make a GET
request to localhost:3000
with the body:
{
"basket":[
{"name": "Apples", "amount": 2},
{"name": "Soup", "amount": 5},
{"name": "Bread", "amount": 2}
],
"date": "1588172702975"
}
Alternatively you can run cli command:
npm run priceBasket -- 1588172702975 Bread --count 2 Soup --count 4