Requires node.js.
- Clone the repo
git clone https://github.com/psilore/yggdrasil.git
- Change to
yggdrasil
directorycd yggdrasil/
- Install NPM packages
npm install
Start yggdrasil and watch for changes on http://localhost:8003
This will also start the API to utilize the endpoints for the frontend.
$ npm run start
ℹ️ Server running at http://localhost:8003
✨ Built in 447ms
$ npm run build
ℹ️ Server running at http://localhost:8003
✨ Built in 447ms
$ npm run test
shoppingcart@1.0.0 test /Users/psiloc/Dev/avensia/shoppingcart
> jest
PASS src/components/Button/Button.test.tsx
Button
✓ handles onClick (33 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 3.097 s
Ran all test suites.
I borrowed this from https://github.com/avensia/api-sample-server.git. Since it is needed for the assignment.
Serve backend content
npm run serve
BASE URL http://localhost:8181
No parameters
Responds with an Array
containing all products.
No parameters
Responds with product identified with the given :id
.
No parameters
Responds with full cart. Cart items and summary.
No parameters
Empty cart. Responds with full updated cart.
Parameters: quantity=[number]
Add quantity
to item with product identified with :id
. Responds with full updated cart.
Parameters: quantity=[number]
Update quantity
to item with product identified with :id
. If item doesn't exist in cart, it will be added with the given quantity
. Responds with full updated cart.
No parameters
Remove item with :id
. Responds with full updated cart.