Does the generated mock server need any packages?
No. It imports only node:http, which is built into Node 18 and newer, so it runs with node mock-server.mjs and no install step.
One file, no dependencies.
Sketch the API your front end needs before the backend exists. Define each endpoint and its response, add realistic latency, and copy a mock server that runs with plain node and nothing to install.
Loading the toolbox.
You do not have to take our word that your data stays here. Developer tools show every request a page makes, so you can watch this page work and confirm that nothing is sent. The check takes under a minute.
F12, or Cmd+Option+I on a Mac, and select the Network tab.Only two things can add a line to that log, and neither carries your data. Submitting the feedback form sends the vote and comment you typed. Typing characters in a script the page has not displayed yet, such as Cyrillic or Greek, can make the browser fetch the matching font file, and that request names only the font.
The production site also sends a Content-Security-Policy header that tells your browser to refuse connections to anywhere except this site and the anonymous analytics endpoint, so a coding mistake could not quietly send your data elsewhere.
API mock writes two files from the endpoints you define. The first is mock-server.mjs, a single JavaScript module that uses only the node:http module that ships with Node. It needs no npm install, no framework, and no configuration file: save it anywhere and run node mock-server.mjs. The second is mocks.json, a fixture keyed by method and path that holds each status code, header set, delay, and body, ready for a test runner or another mock tool to read.
The server answers each defined route with the exact status, headers, and JSON you set, returns a JSON 404 for anything else, and answers CORS preflight requests so a front end on another port can call it during development.
/api/users/:id. A segment that starts with a colon matches any value.Name: value per line, checked for valid names and printable values. Use them for Location, Retry-After, Cache-Control, or a request ID.Every endpoint is listed with its route, status, and delay, and any endpoint with a problem is flagged so a typo never slips into the generated server unnoticed. Duplicate routes are called out too, because only the first one can ever answer.
Paste a real response from an API you already have, and API mock infers a JSON Schema from it. Integers and decimals are told apart, nested objects and arrays are followed all the way down, and strings that look like dates, timestamps, email addresses, URLs, or UUIDs get a matching format. Array items are merged, so a key that appears in only some items is listed as a property but not as required.
From the same example it builds mock variants you can drop into any endpoint with one click:
A mock that answers instantly hides real problems. Loading spinners never appear, double submissions go unnoticed, and race conditions between requests never show up. Give each endpoint its own delay in milliseconds and the generated server waits that long before it responds, so you can see the interface exactly as a user on a slow connection would.
Pair a delay with a 429 status and a Retry-After header to test back-off logic, or with a 500 to check that error states render properly after a pause rather than flashing past.
The generated server is meant for development and testing. It holds every response in memory, never changes state between requests, and should not face the public internet.
Elsewhere in the toolbox: Hash, Base, TOTP, XML, and more on the 2toolbox home page. Part of the 2suite.io privacy-first ecosystem.
No. It imports only node:http, which is built into Node 18 and newer, so it runs with node mock-server.mjs and no install step.
Write a segment that starts with a colon, such as /api/users/:id. It matches any single path segment, so /api/users/7 and /api/users/abc both get that response.
No. Endpoints, bodies, and samples stay in this tab, are never saved, and the page makes no request while you work.
The .mjs extension tells Node to load it as an ES module whatever your package.json says, so the import line works in any project.