Every project I work on hits the same wall: the front end is ready, but the API it calls isn't. Or it is, but it's slow, shared with five other teams, or it only fails in production. So I'd write a quick fake server, throw it away, and write another one next month.
At some point I stopped and built the thing I kept rebuilding. It's called Zyvra, and it's a mock API server that runs on your own computer.
What it does
You create a mock service (it listens on its own local port), add an endpoint like GET /products, and give it a response. Your app points at it instead of the real API. That part is easy and every tool does it. The parts I wanted were these:
- Rules. The answer can depend on the request: path, query, headers or body.
amount > 1000returns "in review", a known test card returns "declined". - Stored state.
POST /orderscreates an order andGET /orders/{id}finds it again, even after a restart. - Failures on purpose. Slow responses, 503s, dropped connections, rate limits with
Retry-After. You can apply them to every 3rd request, or only when a request sends a header likex-chaos: slow, so a failing test fails the same way every time. - Webhooks. After an endpoint answers, it can call another service two seconds later, like the real thing does.
- OpenAPI import. Point it at a spec and you get an endpoint per operation with the spec's examples. When the spec changes you re-import, and the rules you added aren't touched.
It also has an API client and a test runner built in, so the same project works for poking at an API by hand and for running checks in CI.
Try it
curl -fsSL https://www.zyvra.dev/install.sh | sh zyvra init my-project zyvra up (On Windows: irm https://www.zyvra.dev/install.ps1 | iex.) It opens a dashboard in your browser. Nothing leaves your machine, there's no account, and a project is just YAML files in a folder, so it goes into Git with your code.
In CI it's one command:
zyvra run "Checkout flow" --with-mocks --junit report.xml The exit code is 1 if anything fails, and the JUnit file shows up as test results in GitHub Actions or GitLab CI.
Where it's honest about its limits
It's one person on one computer. There are no cloud workspaces or team permissions, and sharing happens through Git. If you want a public URL for a mock that people outside your network can hit, a hosted service is a better fit. And it's new, so expect rough edges.
If you want more
I wrote short guides for the things people usually search for:
- Mock API server on your own computer
- Create a mock API from an OpenAPI spec
- Test API failures: slow, flaky and down
- Run API tests in GitHub Actions and GitLab CI
- Mock API tools compared
I'd really like to hear what breaks, or what you'd want a mock server to do that none of them do. Tell me in the comments.
![Industrial Communication — Ch.10: Factory Automation [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft1hw2kvh64lkchmsurzd.png)


