JSON Server logo

JSON Server

Open Source

Zero-config fake REST API in 30 seconds — point it at a JSON file and you're testing.

Visit websiteGitHub

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

Easy

Maintenance

Low

Learning

Beginner

Licence

Free / Open source

// 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

ToolChoose it when
MockoonYou want a GUI to design richer mock responses and rules.
MockServerYou 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

  1. Create a db.json describing your resources

  2. Install and run JSON Server pointing at the file

  3. Use the generated CRUD routes from your frontend

  4. Use filtering/sorting/pagination as needed

  5. Commit db.json so CI and local match

  6. Move to a richer mock when you outgrow it

// RELATED QA.CODES RESOURCES