JSON Server
Zero-config fake REST API in 30 seconds — point it at a JSON file and you're testing.
Pricing
Free / Open source
Type
Automation
Languages
JavaScript
// VERDICT
Reach for JSON Server when you want a throwaway REST API from a JSON file to unblock frontend work fast. Skip it when you need expectation-based stubbing, request verification, or robust integration-test mocking.
Best for
Spinning up a full fake REST API from a single JSON file in seconds - zero-config prototyping and frontend development against realistic endpoints.
Avoid when
You need precise request matching, verification, or production-grade mocking for serious integration tests.
CI/CD fit
npm · Docker · GitHub Actions · GitLab CI
Languages
JavaScript
Team fit
Frontend teams · Prototypers · Developers needing a quick fake API
Setup
Maintenance
Learning
Licence
// BEST FOR
- Generating a full REST API (CRUD routes) from one JSON file
- Unblocking frontend development before the real backend exists
- Prototyping and demos that need realistic-looking endpoints fast
- Zero configuration - point it at a file and it serves
- Filtering, sorting, pagination and relationships out of the box
- A disposable local API for manual and exploratory testing
// AVOID WHEN
- You need precise request matching or response logic
- Verifying the system made specific requests matters (MockServer)
- Serious integration-test isolation is the goal (WireMock/MockServer)
- You need realistic auth, edge-case errors or stateful flows
- Network-layer mocking inside JS tests fits better (MSW)
- Production-like fidelity is required
// QUICK START
npm install -g json-server
json-server --watch db.json// ALTERNATIVES TO CONSIDER
| Tool | Choose it when |
|---|---|
| Mockoon | You want a GUI to design richer mock responses and rules. |
| MockServer | You need expectation matching and request verification. |
| MSW (Mock Service Worker) | You want to mock at the network layer inside JS tests. |
// FEATURES
- Auto-generated CRUD endpoints from a JSON file
- Filtering, sorting, pagination, and full-text search
- Custom routes via routes.json
- Middleware hooks for advanced behaviour
- Snapshot rollback for quick state reset
// PROS
- Fastest way to prototype against a fake REST API
- Zero configuration for basic CRUD
- Tiny dependency footprint
// CONS
- Not for production use
- Single-process — limited concurrency
- Schema-less — no validation beyond what you script
// EXAMPLE QA WORKFLOW
Create a db.json describing your resources
Install and run JSON Server pointing at the file
Use the generated CRUD routes from your frontend
Use filtering/sorting/pagination as needed
Commit db.json so CI and local match
Move to a richer mock when you outgrow it