cart-dart

License: GPL v3

Dart

Add dependencies

dart pub add shelf

Install dependencies

dart pub get

Run Tests

dart test

Run Server

dart run bin/main.dart

Post Item 1

curl -X POST http://localhost:8080/cart \
-H "Content-Type: application/json" \
-d '{"productId": "123", "quantity":5}'
Item added to cart%          

View Cart

curl -X GET http://localhost:8080/cart
[{"productId":"123","quantity":5}]%   

Post Item 2

curl -X POST http://localhost:8080/cart \
-H "Content-Type: application/json" \
-d '{"productId": "732", "quantity":7}'
Item added to cart%      

View Cart

curl -X GET http://localhost:8080/cart
[{"productId":"123","quantity":5},{"productId":"732","quantity":7}]%