November 2, 2025
Slow your roll, devs
Mock – An API creation and testing utility: Examples
Tool that fakes APIs and adds delays sparks Windows worries and 'why switch?' debate
TLDR: A new tool called Mock lets developers fake APIs, add delays to specific endpoints, and test routes in multiple languages. Commenters loved the simplicity but argued over missing Windows releases, name confusion with another “mock,” and whether it’s worth switching from existing tools like WireMock.
“Mock” just dropped a demo showing how you can fake an API, slow down specific endpoints on purpose, run routes powered by Node, Python, and PHP, and even keep count of how many times it’s been pinged. It’s like a dress rehearsal for your app—complete with intentional delays and a stateful counter that brags, “we’ve had 3 requests so far!” The crowd loved the simplicity: one command to act as a proxy and add a 2-second pause to a single path. Chef’s kiss for demos that actually work.
Then the comments lit up. Windows users stormed in asking, “does it even run on Windows?” after not finding a release—cue cross‑platform anxiety and a mini OS flame war. One fan cheered, “Wonderful little tool!” while the skeptics crashed the party: “Why should people switch?” when tools like WireMock already exist. Another twist: drama over the name. Veterans pointed out there’s already an RPM tool called “mock”, prompting confusion and rename requests.
Best meme of the day? A commenter dubbed the delay feature the “billable hours variable,” implying some devs might “slow it down” for… reasons. The vibe: excited tinkering meets practical questions. People want dynamic responses from request data, Windows support, and clarity on why this “Mock” is different enough to matter.
Key Points
- •Mock can globally delay responses when proxying a base API using the --delay option.
- •Endpoint-specific delays are implemented via middleware using the MOCK_REQUEST_ENDPOINT variable and sleep.
- •Mock can proxy requests to an existing API (example.com) on localhost while customizing behavior per path.
- •Routes can be handled by inline Node.js, Python, and PHP code via --route and --exec, returning outputs with mock write.
- •A stateful API is built using a temp file, bc, and sponge to track and return the number of requests received.