Minimal Go service that accepts POST /persist with a JSON transaction body and persists it.
Usage
cd Books/books.handlers.persisttransactions
go build -v
PERSIST_FILE=transactions.log PORT=:8080 ./books.handlers.persisttransactions
# or run directly
PERSIST_FILE=transactions.log go run .
Example request:
curl -X POST http://localhost:8080/persist -d '{"id":123, "amount": 9.99}' -H 'Content-Type: application/json'
Environment
PERSIST_FILE — optional path to append JSON lines of incoming transactions.PORT — optional listen address (default :8080).