Library · Jul 2022 — present
HTTP Mock JSON
HTTP mocks from JSON
Author & maintainer
A lightweight tool that spins up an HTTP mock server from JSON files. Use it when the backend is missing or late: define routes and responses without boilerplate, with validation and TypeScript.
More detail
- CLI (`mock-server init`, `start`, `add`) scaffolds a mocks folder, optional starter JSON, and a `mock:start` script in package.json.
- Validates all mock files before binding the port: endpoint format, HTTP methods, response fields, `nameResponse` references, and parseable JSON.
- Watch mode reloads definitions on save; if validation fails after a change, the server surfaces errors and waits for a fix.
- Multiple named responses per route, optional response headers, REST verbs, and dynamic segments such as `/data/items/:id`.
- Shipped on npm for a TypeScript-first, Node 18+ dev workflow aimed at frontend teams working without a live API.
Stack
- TypeScript
- Node.js
Links
Public resources (open in a new tab).