How to use the Mock API Response Generator
- Set the method, path and status code — common error bodies are filled in for you.
- Edit the JSON body, headers and delay.
- Copy the MSW handler, Express route or test mock.
What does this tool do?
Mocking lets you build and test UI before the backend exists, and simulate errors and slow networks that are hard to reproduce. The tool outputs Mock Service Worker handlers (for browsers and Node tests), an Express route for a quick fake server, or a one-line fetch mock for Jest and Vitest.
Everything runs in your browser — nothing you paste is uploaded.
Why use it?
- Four output styles.
- Error presets.
- Simulated delay.
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Last reviewed by the M2Toolkit team.