# json-server | typicode | Knowledge Base | Instagit

Get a full fake REST API with zero coding in less than 30 seconds (seriously)

GitHub Stars: 75.6k

Repository: https://github.com/typicode/json-server

---

## Articles

### [How JSON Server Uses lowdb for In-Memory JSON Database Operations](/typicode/json-server/how-does-json-server-use-lowdb-for-its-json-database-operations)

Discover how JSON Server leverages lowdb for in-memory JSON database operations. Learn about its adapters, normalization, and event handling for efficient data management.

- Tags: how-to-guide
- Published: 2026-03-01

### [How JSON Server's service.ts Implements Core Business Logic: A Deep Dive](/typicode/json-server/explain-the-core-business-logic-in-json-servers-service.ts)

Explore JSON Server's service.ts to understand how it builds a REST API from JSON data, managing CRUD, queries, and relationships. Master its core business logic.

- Tags: deep-dive
- Published: 2026-03-01

### [How app.ts Creates the HTTP Server and Defines Routes in JSON Server](/typicode/json-server/how-does-app.ts-create-the-http-server-and-define-routes-in-json-server)

Discover how app.ts in JSON Server builds the HTTP server and defines routes. Learn about middleware, RESTful routes, and CRUD operations.

- Tags: internals
- Published: 2026-03-01

### [What Is the Role of bin.ts in JSON Server's CLI?](/typicode/json-server/what-is-the-role-of-bin.ts-in-json-servers-cli)

Explore the vital role of bin.ts in JSON Server's CLI. Discover how it manages argument parsing, database setup, server startup, and live-reload for efficient API development.

- Tags: internals
- Published: 2026-03-01

### [How to Customize JSON Server with Custom Routes and Middleware](/typicode/json-server/how-to-customize-json-server-with-custom-routes-and-middleware)

Learn how to customize JSON Server with custom routes and middleware. Easily extend your mock API using the createApp function and Tinyhttp compatible middleware for flexible development.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Use Complex Where Queries with the _where Parameter in JSON Server](/typicode/json-server/how-to-use-complex-where-queries-with-the-_where-parameter-in-json-server)

Master complex where queries in JSON Server using the _where parameter. Learn to filter resources with precision using advanced field operators and logical conditions. Boost your API development today.

- Tags: how-to-guide
- Published: 2026-03-01

### [Deployment Options for JSON Server: A Complete Guide to Hosting Your Mock API](/typicode/json-server/what-are-the-deployment-options-for-json-server)

Explore diverse JSON Server deployment options from local machines to cloud platforms like Heroku Vercel Netlify AWS Lambda Google Cloud Run and Azure. Host your mock API easily.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Migrate from JSON Server v0 to v1: Complete Upgrade Guide](/typicode/json-server/how-to-migrate-from-json-server-version-0-to-version-1)

Easily migrate from JSON Server v0 to v1. Learn how to update pagination, relationships, IDs, and CLI flags with this complete upgrade guide.

- Tags: migration-guide
- Published: 2026-03-01

### [How to Secure JSON Server in a Production Environment: 7 Essential Hardening Steps](/typicode/json-server/how-to-secure-json-server-in-a-production-environment)

Secure JSON Server in production with 7 essential steps. Learn to restrict CORS, implement authentication, guard HTTP verbs, and use a reverse proxy to protect your API.

- Tags: how-to-guide
- Published: 2026-03-01

### [Performance Considerations for JSON Server with Large JSON Databases](/typicode/json-server/what-are-the-performance-considerations-for-json-server-with-large-json-databases)

Discover performance issues with JSON Server and large databases. Understand memory pressure and latency with O(N) scans and full rewrites for datasets over thousands of records.

- Tags: performance
- Published: 2026-03-01

### [How to Write Tests for JSON Server Customizations: A Complete Guide](/typicode/json-server/how-to-write-tests-for-json-server-customizations)

Learn to write tests for JSON Server customizations using Node.js native test runner and LowDB. Test live endpoints with fetch and assert against HTTP instances.

- Tags: how-to-guide
- Published: 2026-03-01

### [How the JSON Server Routing System Works: From HTTP Request to CRUD Operation](/typicode/json-server/how-does-the-json-server-routing-system-work)

Explore the JSON Server routing system. Discover how it maps HTTP requests to CRUD operations using tinyhttp and middleware, delegating data tasks to a Service class.

- Tags: internals
- Published: 2026-03-01

### [How to Handle Errors and Validation in JSON Server](/typicode/json-server/how-to-handle-errors-and-validation-in-json-server)

Learn to handle errors and validation in JSON Server with custom middleware. Implement robust input validation and error management for your mock API.

- Tags: how-to-guide
- Published: 2026-03-01

### [How JSON Server Generates and Handles Resource IDs: A Complete Technical Guide](/typicode/json-server/how-does-json-server-generate-and-handle-ids-for-resources)

Discover how JSON Server generates stable, unique 4-character hexadecimal IDs for resources. Learn about ID assignment in POST requests and immutable updates.

- Tags: deep-dive
- Published: 2026-03-01

### [How Cascading Deletes Work with the `_dependent` Parameter in JSON Server](/typicode/json-server/how-do-cascading-deletes-work-with-the-_dependent-parameter-in-json-server)

Understand cascading deletes in JSON Server using the _dependent parameter. Learn how to nullify foreign keys and purge related records for efficient data management.

- Tags: how-to-guide
- Published: 2026-03-01

### [How File Watching Works in JSON Server for Development](/typicode/json-server/how-does-file-watching-in-json-server-work-for-development)

Discover how JSON Server's file watching leverages chokidar and observer patterns to automatically reload your mock API on database file changes during development.

- Tags: internals
- Published: 2026-03-01

### [How to Configure Custom Port and Host in JSON Server: Complete Guide](/typicode/json-server/how-to-configure-custom-port-and-host-in-json-server)

Learn how to configure custom port and host in JSON Server. Easily set your port and host using CLI flags, environment variables, or programmatic configuration. Master your mock API setup.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Serve Static Files with JSON Server: A Complete Guide](/typicode/json-server/how-to-serve-static-files-with-json-server)

Learn how to serve static HTML, CSS, and JS files with JSON Server. This guide details using the built-in sirv middleware and CLI flags for your mock REST API.

- Tags: how-to-guide
- Published: 2026-03-01

### [How JSON Server Handles Relationships Between Collections: The Complete Guide to `_embed`](/typicode/json-server/how-does-json-server-handle-relationships-between-collections)

Learn how JSON Server handles collection relationships using the _embed query parameter for automatic foreign key resolution and embedded data merging.

- Tags: deep-dive
- Published: 2026-03-01

### [How to Embed Related Resources in JSON Server Responses Using `_embed`](/typicode/json-server/how-to-embed-related-resources-in-json-server-responses-using-_embed)

Effortlessly embed related resources in JSON Server responses with the _embed query parameter. Enhance your API by including related data in a single GET request. Learn how to use _embed now.

- Tags: how-to-guide
- Published: 2026-03-01

### [How Pagination Works in JSON Server with _page and _per_page Parameters](/typicode/json-server/how-does-pagination-work-in-json-server-with-_page-and-_per_page-parameters)

Learn how pagination works in JSON Server using _page and _per_page parameters to control API response and page size. Get navigation links.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Sort JSON Server API Responses Using the _sort Query Parameter](/typicode/json-server/how-to-sort-json-server-api-responses-with-_sort-parameter)

Easily sort JSON Server API responses with the _sort query parameter. Learn to order array resources by field, ascending or descending, for better data management.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Filter JSON Server Results Using Query Operators Like gt, lt, and eq](/typicode/json-server/how-to-filter-json-server-results-using-query-operators-like-gt-lt-eq)

Easily filter JSON Server results with query operators like gt, lt, and eq. Learn the simple colon syntax field:operator=value for powerful data manipulation. Get better API control today.

- Tags: how-to-guide
- Published: 2026-03-01

