Proxy the real API, mock what is missing
Your mock API forwards to the real backend and mocks the endpoints it does not serve yet. Real data where it exists, generated data where it does not.
- Real and mocked together
- One URL for the app
- Response caching
- Everything recorded
What is a proxy with mock fallback?
The mock server tries your real backend first and passes through whatever it answers, status and headers included. Anything that backend does not handle is answered from the spec instead of failing.
Your app calls one URL. Which responses came from the real API and which were generated is decided at the mock server, not in your code, so nothing on your side changes when the missing half ships.
Half of every integration already exists
Real work is rarely all or nothing. Three endpoints are live, two are still being built, and one only behaves in an environment you cannot reach. Mocking everything throws away the real behaviour you have, and mocking nothing leaves you blocked.
Proxying with fallback keeps both. The endpoints that exist behave exactly like production, and the ones that do not still return something valid.
Upstream first
Status, headers and body come back untouched. Your client cannot tell the request went through a mock at all.
Mock fallback
You do not have to say which endpoints are missing. Whatever upstream does not answer falls through to the spec.
Response caching
Cache GET responses so the same request returns the same body, even when the data behind the real API keeps changing.
Questions
- What happens when the real API is down?
- The request falls back to the mock, so your work is not blocked by somebody else's outage.
- Can I see which responses came from where?
- Yes, on every response. X-Mockzilla-Source comes back as upstream, cache or generated, so your client can tell without asking and a test can assert on it. Request history records the calls as well.
- Do I have to change my app to use it?
- No. The base URL you already point at stays the same, and nothing else in your client changes.
Bring a spec. Get a mock server.
It costs nothing to start. Dedicated infrastructure when you need it.