Gateway Gus saysMock servers return canned responses so you can develop against an API that isn’t ready.
A mock stands in for a real API: it returns predefined responses for given requests. This unblocks front-end work before the backend exists, lets you simulate errors and edge cases on demand, and keeps tests fast and deterministic (no network). Generate mocks from an OpenAPI spec, or use tools like MSW (browser) and WireMock.
Power-ups you unlock
Canned responses stand in for the real API
Unblocks front-end before backend exists
Simulate errors/edge cases deterministically
Generate from OpenAPI; MSW/WireMock
Timeout Titan attacks — common mistakes
Mocks drifting from the real API shape
Only mocking the happy path
Shipping with mocks accidentally enabled
Boss battleName two things a mock lets you test that a live API makes hard.
Example code
<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>mock GET /users/42 → 200 fixed user
mock GET /users/99 → 500 (test error UI on demand)</pre></body></html>