- Node
- npm
npm install
npm start
npm test
npm test
- Can configure prices of items and discounts in config.js
- REST API
- POST to localhost:8081/basket
- HEADER: Content-Type:application/json
- POST BODY (JSON):
{
"items": Array<"Soup" | "Bread" | "Milk" | "Apples">,
"currency" : "GBP" | "EUR" | "USD"
}
- Response:
{
"subTotal": number,
"discounts": Array<"Apples 10% off" | "3 Milk 50 cents off"> | [],
"discountAmt": number,
"total": number,
"currency": "GBP" | "EUR" | "USD"
}