# typicode/json-server

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/typicode-json-server).**

75,614 stars · 7,268 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/typicode/json-server
- awesome-repositories: https://awesome-repositories.com/repository/typicode-json-server.md

## Topics

`api` `fake` `frontend` `json` `mock` `rest` `test`

## Description

json-server is a development toolset used to simulate a full REST API from a JSON file. It functions as a customizable mock API server that allows for the simulation of CRUD operations and resource relationships without the need to write backend code.

The project enables rapid prototyping by generating a fake backend that persists data changes back to a local JSON file. It distinguishes itself by providing a static asset file server to deliver local documents, images, and stylesheets alongside the mock API endpoints.

The server includes capabilities for data querying, such as parameter-based filtering, pagination, and sorting. It also supports resource relationship management through relational data embedding and offers extensibility via a middleware-based request pipeline for custom logic and authentication.

## Tags

### Web Development

- [Dynamic REST API Generators](https://awesome-repositories.com/f/web-development/api-management-tools/api-development-management/api-generation/dynamic-rest-api-generators.md) — Generates a full RESTful API dynamically from a local JSON file to simulate a backend. ([source](https://github.com/typicode/json-server#readme))
- [API Mocking Servers](https://awesome-repositories.com/f/web-development/api-mocking-servers.md) — Functions as a local mocking server that simulates CRUD operations and complex query filtering.
- [Mocking Tools](https://awesome-repositories.com/f/web-development/json-apis/mocking-tools.md) — Generates a full mock REST API directly from a JSON file.

### Data & Databases

- [JSON-Based Persistence](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage/file-based-storage/local-file-storage/json-based-persistence.md) — Persists application data as structured JSON files on the local filesystem.
- [Data Query Filters](https://awesome-repositories.com/f/data-databases/data-query-filters.md) — Implements field-based criteria and logical operators for narrowing down data sets via API requests. ([source](https://github.com/typicode/json-server#readme))
- [Query Parameter Filters](https://awesome-repositories.com/f/data-databases/data-querying/query-parameter-filters.md) — Transforms URL query parameters into filters, sorts, and pagination logic for data retrieval. ([source](https://github.com/typicode/json-server/blob/main/README.md))
- [Relational Resource Mapping](https://awesome-repositories.com/f/data-databases/data-resource-management/relational-resource-mapping.md) — Allows fetching related data by embedding child resources or expanding parent references in a single request. ([source](https://github.com/typicode/json-server/tree/v0.17.4))
- [Data Mocking](https://awesome-repositories.com/f/data-databases/json-data-parsers/data-mocking.md) — Simulates API responses and resource relationships using static JSON data files.
- [Mock State Management](https://awesome-repositories.com/f/data-databases/mock-state-management.md) — Performs standard CRUD operations on collection arrays and singular object resources via HTTP methods. ([source](https://github.com/typicode/json-server/blob/main/README.md))
- [Relational Data Embedding](https://awesome-repositories.com/f/data-databases/object-relational-mappings/inline-related-objects/relational-data-embedding.md) — Resolves links between different JSON collections by embedding child objects or expanding parent references.
- [Query Filters](https://awesome-repositories.com/f/data-databases/query-sorting/query-filters.md) — Supports range-based constraints, slicing, and sorting to retrieve specific subsets of data. ([source](https://github.com/typicode/json-server/tree/v0.17.4))
- [Pagination](https://awesome-repositories.com/f/data-databases/pagination.md) — Splits large data collections into smaller, manageable pages using page and per-page parameters. ([source](https://github.com/typicode/json-server#readme))

### Development Tools & Productivity

- [Automatic Endpoint Mapping](https://awesome-repositories.com/f/development-tools-productivity/automatic-endpoint-mapping.md) — Maps URL paths to JSON arrays based on the keys found in the source file to create automatic endpoints.
- [Local Development Servers](https://awesome-repositories.com/f/development-tools-productivity/local-development-servers.md) — Provides a lightweight local server to manage stateful CRUD operations and resource relationships.
- [API Route Customization](https://awesome-repositories.com/f/development-tools-productivity/api-route-customization.md) — Provides configuration options to map custom URL paths to specific JSON resources. ([source](https://github.com/typicode/json-server/tree/v0.17.4))

### Testing & Quality Assurance

- [API Mocking](https://awesome-repositories.com/f/testing-quality-assurance/api-network-testing/api-mocking.md) — Provides a tool for simulating API responses to facilitate frontend development without a live backend.
- [Frontend Integration Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/test-levels-and-types/component-testing-frameworks/frontend-integration-testing.md) — Simulates a predictable local data source to test how frontend applications handle various API responses.

### Networking & Communication

- [Middleware-Based Request Pipelines](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/request-processing/middleware-based-request-pipelines.md) — Processes incoming HTTP requests through a modular chain of pluggable functions for custom logic.

### Software Engineering & Architecture

- [Rapid Prototyping](https://awesome-repositories.com/f/software-engineering-architecture/development-methodologies/rapid-prototyping.md) — Enables a rapid prototyping workflow by simulating server responses to iterate on features quickly.
- [Custom Middleware Implementations](https://awesome-repositories.com/f/software-engineering-architecture/middleware/custom-middleware-implementations.md) — Supports custom middleware and request handlers for authentication, validation, and response behaviors. ([source](https://github.com/typicode/json-server/tree/v0.17.4))

### Part of an Awesome List

- [API Debugging and Mocking](https://awesome-repositories.com/f/awesome-lists/devtools/api-debugging-and-mocking.md) — Creates a full fake REST API with zero coding.
- [HTTP Clients](https://awesome-repositories.com/f/awesome-lists/devtools/http-clients.md) — Instant mock REST API from JSON files.
- [Testing Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/testing-frameworks.md) — Zero-code REST API mock server.
