Documentation
¶
Overview ¶
Command mockmachine is a tiny stand-in for a Meticulous espresso machine, enough to let the caffeine backend run end-to-end against `http://meticulous.local` (or any localhost URL) without real hardware. It speaks just the endpoints caffeine polls:
- GET / → 200 OK (reachability probe)
- GET /api/v1/history → JSON shot history
- GET /api/v1/action/preheat → 200 OK (ack)
- WS /socket.io/?EIO=4&… → Engine.IO v4 + socket.io v4 emitting "status" events that simulate a live extraction
To point caffeine at it, run the mock on the port of your choice and set MACHINE_URL=http://localhost:<port>. To keep the default http://meticulous.local URL working, add a hosts entry instead:
sudo sh -c 'echo "127.0.0.1 meticulous.local" >> /etc/hosts' mockmachine -addr :80 # needs sudo for port 80
Usage:
mockmachine -addr :8090 -simulate 20s
With -simulate set, the mock fires a fake 25-second extraction every N (default 0 = disabled; must be opened explicitly to avoid stealing focus on Live when the user is just smoke-testing /history).
Click to show internal directories.
Click to hide internal directories.