Mock API Generator
Define API routes with a status code, a delay, and a JSON response, and get handlers.js for MSW or db.json for json-server. No real backend needed.
Routes
Columns: method, path (with :id for a parameter), status code, and delay in milliseconds.
422 characters422 bytes
Use handlers.js with setupWorker or setupServer from the msw package (version 2).
How to Use It
- Describe the routes and the answers.
- Choose MSW or json-server as the output.
- Copy or download the file.
Questions and Answers
What is MSW?
Mock Service Worker catches requests in the browser or in Node and gives test answers, so a front end works without the real server.
Good to Know
The tool runs no server; it only writes a config file. json-server uses GET routes without parameters only.
Related Tools
Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)