Navigate:
All Reposjson-server
~$JSONSE0.0%

JSON Server: Fake REST API from JSON files

Zero-config REST API server from JSON files.

LIVE RANKINGS • 08:16 AM • STEADY
OVERALL
#198
30
DEVELOPER TOOLS
#41
5
30 DAY RANKING TREND
ovr#198
·Devel#41
STARS
75.5K
FORKS
7.3K
DOWNLOADS
238.6K
7D STARS
+17
7D FORKS
+2
See Repo:
Share:

Learn more about json-server

JSON Server is a Node.js command-line tool that creates a functional REST API by reading data from a JSON or JSON5 file. It automatically generates standard HTTP endpoints (GET, POST, PUT, PATCH, DELETE) for each top-level property in the data file, handling routing and basic data operations internally. The tool supports query parameters for filtering, sorting, pagination, and nested field access, along with static file serving from a public directory. It is commonly used during frontend development, API prototyping, and testing scenarios where a real backend is not yet available.

json-server

1

Zero configuration setup

Requires only a JSON file to generate a complete REST API. No server code, configuration files, or build steps are needed beyond running the CLI command.

2

Query parameter filtering

Supports conditional operators (gt, gte, lt, lte, ne), range queries, pagination, sorting, and nested field access through query strings without custom endpoint logic.

3

JSON5 format support

Accepts both standard JSON and JSON5 files, allowing unquoted keys, trailing commas, and comments in data files for easier manual editing during development.


import axios from 'axios';

// Get all posts from json-server endpoint
const response = await axios.get('http://localhost:3000/posts');
const posts = response.data;

console.log(posts);

vv1.0.0-beta.3

Maintenance release fixing CORS header restrictions and updating dependencies; no breaking changes or new requirements specified.

  • CORS now permits any request header, removing prior header whitelist restrictions.
  • All dependencies updated; release notes do not specify version requirements or migration steps.
vv1.0.0-beta.2

Fixes filtering to support multiple range conditions on the same field (e.g., views_gt=100&views_lt=500).

  • Update query strings to combine range operators (e.g., _gt, _lt) on a single field for refined filtering.
  • Release notes do not specify breaking changes, new requirements, or migration steps.
vv1.0.0-beta.1

Beta patch fixing a query parameter bug and updating dependencies; no breaking changes or new requirements specified.

  • Update to resolve incorrect query parameter handling reported in issue #1551.
  • Dependency updates included; release notes do not specify versions or security fixes.


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers