JSON Server turns a JSON or JSON5 database file into a REST API for local prototyping. It supports filtering, sorting, pagination, embedding relations, and static assets.
Overview
JSON Server is a tool that serves a fake REST API from a simple data file such as db.json or db.json5 without writing server code. After installation you create the data file, start the process, and call standard HTTP routes against collections and single-object resources.
Query features include field operators for comparisons and text matching, sort parameters, pagination with page and per-page limits, embed parameters for related records, and structured where filters. IDs are handled as strings and auto-generated when missing.
The server can expose files from a public directory and optionally additional static paths for HTML, scripts, and images used alongside the API. Documentation notes behavioral differences when moving from older major versions, including pagination and relationship parameter names.
It is oriented toward frontend and test workflows that need a stand-in backend while a real service is still under development.
Key features
- REST routes from JSON files
- JSON5 database support
- Rich query operators
- Sort and pagination
- embed related resources
- where JSON filter objects
- Built-in static file serving
- Array and singular resources
Use cases
- Frontend prototype backends
- Contract testing during UI work
- Demo apps without a real API
- Teaching REST client integration
- Local mock data for SPAs