A simple WASM based REST API.
Build a docker image for WASM.
cd mysql-client
docker compose build
Run the container.
docker compose up -d
Put an order:
$ curl -d "{\"order_id\": 1,\"account_id\": 1,\"product_id\": 1,\"quantity\": 1}" -X POST http://localhost:8080/orders
{"status":"success"}
$ curl -d "{\"order_id\": 2,\"account_id\": 100,\"product_id\": 15,\"quantity\": 3}" -X POST http://localhost:8080/orders
{"status":"success"}
Get orders:
$ curl http://localhost:8080/orders
[{"order_id":1,"account_id":1,"product_id":1,"quantity":1},{"order_id":2,"account_id":100,"product_id":15,"quantity":3}]
Clean up the containers:
docker compose down