Skip to content
#0275
Exec

The mock API and the real one answer at the same path

The backend team says the orders endpoint lands in two sprints. You need it today.

You write orders/[id].ts in the exec instance named exec-test and return the JSON you agreed on. Your React app points at it. When the real handler is ready, it lands in exec-1 at the same path, and you change one hostname. The payload shape is already battle-tested because the UI has been eating it for two weeks.

Need the mock to flake like production will? A pre.ts beside it returns a 503 every fifth request and skips the main script. No mock-server library, no MSW fixtures, no second process to keep running.

The contract ships before the backend, at the URL the backend will have.