JSON Server: Fake REST API from JSON files
Zero-config REST API server from JSON files.
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.
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.
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.
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);v1.0.0-beta.5
- –feat: add JSON Schema by @typicode in
- –v1.0.0-beta.5 by @typicode in
v1.0.0-beta.4
- –perf: replace Object.entries/fromEntries with Object.keys for better performance by @ssi02014 in
- –fix: handle undefined case in filtering logic by @manikanta5827 in
- –chore: use oxlint by @Copilot in
- –Drop Node.js 20 support and enforce erasable TypeScript syntax by @Copilot in
- –use TS natively and switch to pnpm by @typicode in
v1.0.0-beta.3: fix: allow any request header in CORS
- –fix: allow any request header in CORS
- –chore: update all dependencies
Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
Cursor AI Downloads
Community repository with download links for all Cursor AI editor versions across Windows, macOS, and Linux.
Pug
Whitespace-sensitive template engine compiling to HTML for Node.js with Haml-inspired syntax.
playwright
Cross-browser automation framework with built-in test runner.
corepack
Enforces package manager versions specified in package.json.
grbl
Real-time motion control firmware for Arduino-based CNCs.