Skip to main content
HandyWeb

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

Route 1
Route 2

Columns: method, path (with :id for a parameter), status code, and delay in milliseconds.

Output
422 characters422 bytes

Use handlers.js with setupWorker or setupServer from the msw package (version 2).

How to Use It

  1. Describe the routes and the answers.
  2. Choose MSW or json-server as the output.
  3. 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.

Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)