[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-412":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":36,"discoverSource":37},412,"json-server","typicode\u002Fjson-server","typicode","Get a full fake REST API with zero coding in less than 30 seconds (seriously)","",null,"JavaScript",75614,7268,979,615,0,2,33,75,11,98,"MIT License",false,"main",[26,27,28,29,30,31,32],"api","fake","frontend","json","mock","rest","test","2026-06-17 04:00:03","# JSON-Server\n\n[![Node.js CI](https:\u002F\u002Fgithub.com\u002Ftypicode\u002Fjson-server\u002Factions\u002Fworkflows\u002Fnode.js.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftypicode\u002Fjson-server\u002Factions\u002Fworkflows\u002Fnode.js.yml)\n\n> [!IMPORTANT]\n> Viewing beta v1 documentation – usable but expect breaking changes. For stable version, see [here](https:\u002F\u002Fgithub.com\u002Ftypicode\u002Fjson-server\u002Ftree\u002Fv0.17.4)\n\n> [!NOTE]\n> Using React ⚛️ and tired of CSS-in-JS? See [MistCSS](https:\u002F\u002Fgithub.com\u002Ftypicode\u002Fmistcss) 👀\n\n## Install\n\n```shell\nnpm install json-server\n```\n\n## Usage\n\nCreate a `db.json` or `db.json5` file\n\n```json\n{\n  \"$schema\": \".\u002Fnode_modules\u002Fjson-server\u002Fschema.json\",\n  \"posts\": [\n    { \"id\": \"1\", \"title\": \"a title\", \"views\": 100 },\n    { \"id\": \"2\", \"title\": \"another title\", \"views\": 200 }\n  ],\n  \"comments\": [\n    { \"id\": \"1\", \"text\": \"a comment about post 1\", \"postId\": \"1\" },\n    { \"id\": \"2\", \"text\": \"another comment about post 1\", \"postId\": \"1\" }\n  ],\n  \"profile\": {\n    \"name\": \"typicode\"\n  }\n}\n```\n\n\u003Cdetails>\n\n\u003Csummary>View db.json5 example\u003C\u002Fsummary>\n\n```json5\n{\n  posts: [\n    { id: \"1\", title: \"a title\", views: 100 },\n    { id: \"2\", title: \"another title\", views: 200 },\n  ],\n  comments: [\n    { id: \"1\", text: \"a comment about post 1\", postId: \"1\" },\n    { id: \"2\", text: \"another comment about post 1\", postId: \"1\" },\n  ],\n  profile: {\n    name: \"typicode\",\n  },\n}\n```\n\nYou can read more about JSON5 format [here](https:\u002F\u002Fgithub.com\u002Fjson5\u002Fjson5).\n\n\u003C\u002Fdetails>\n\nStart JSON Server\n\n```bash\nnpx json-server db.json\n```\n\nThis starts the server at `http:\u002F\u002Flocalhost:3000`. You should see:\n```\nJSON Server started on PORT :3000\nhttp:\u002F\u002Flocalhost:3000\n```\n\nAccess your REST API:\n\n```bash\ncurl http:\u002F\u002Flocalhost:3000\u002Fposts\u002F1\n```\n\n**Response:**\n```json\n{\n  \"id\": \"1\",\n  \"title\": \"a title\",\n  \"views\": 100\n}\n```\n\nRun `json-server --help` for a list of options\n\n## Sponsors ✨\n\n### Gold\n\n|                                                                                                                                                            |\n| :--------------------------------------------------------------------------------------------------------------------------------------------------------: |\n|               \u003Ca href=\"https:\u002F\u002Fmockend.com\u002F\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fjsonplaceholder.typicode.com\u002Fmockend.svg\" height=\"100px\">\u003C\u002Fa>               |\n| \u003Ca href=\"https:\u002F\u002Fzuplo.link\u002Fjson-server-gh\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fadfee31f-a8b6-4684-9a9b-af4f03ac5b75\" height=\"100px\">\u003C\u002Fa> |\n|     \u003Ca href=\"https:\u002F\u002Fwww.mintlify.com\u002F\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fbcc8cc48-b2d9-4577-8939-1eb4196b7cc5\" height=\"100px\">\u003C\u002Fa>     |\n| \u003Ca href=\"http:\u002F\u002Fgit-tower.com\u002F?utm_source=husky&utm_medium=referral\">\u003Cimg height=\"100px\" alt=\"tower-dock-icon-light\" src=\"https:\u002F\u002Fjsonplaceholder.typicode.com\u002Ftower-icon-and-logo-1400x260.png\" \u002F>\u003C\u002Fa> |\n| \u003Ca href=\"https:\u002F\u002Fserpapi.com\u002F?utm_source=typicode\">\u003Cimg height=\"100px\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F52b3039d-1e4c-4c68-951c-93f0f1e73611\" \u002F>\u003C\u002Fa>\n\n\n### Silver\n\n|                                                                                                                                                                                                                                         |\n| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |\n| \u003Ca href=\"https:\u002F\u002Frequestly.com?utm_source=githubsponsor&utm_medium=jsonserver&utm_campaign=jsonserver\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Ff7e7b3cf-97e2-46b8-81c8-cb3992662a1c\" style=\"height:70px; width:auto;\">\u003C\u002Fa> |\n\n### Bronze\n\n|                                                                                                                                                                                |                                                                                                                                                                              |\n| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |\n| \u003Ca href=\"https:\u002F\u002Fwww.storyblok.com\u002F\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Ftypicode\u002Fjson-server\u002Fassets\u002F5502029\u002Fc6b10674-4ada-4616-91b8-59d30046b45a\" height=\"35px\">\u003C\u002Fa> | \u003Ca href=\"https:\u002F\u002Fbetterstack.com\u002F\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Ftypicode\u002Fjson-server\u002Fassets\u002F5502029\u002F44679f8f-9671-470d-b77e-26d90b90cbdc\" height=\"35px\">\u003C\u002Fa> |\n\n[Become a sponsor and have your company logo here](https:\u002F\u002Fgithub.com\u002Fusers\u002Ftypicode\u002Fsponsorship)\n\n## Query Capabilities\n\nJSON Server supports advanced querying out of the box:\n\n```http\nGET \u002Fposts?views:gt=100                  # Filter by condition\nGET \u002Fposts?_sort=-views                  # Sort by field (descending)\nGET \u002Fposts?_page=1&_per_page=10          # Pagination\nGET \u002Fposts?_embed=comments               # Include relations\nGET \u002Fposts?_where={\"or\":[...]}           # Complex queries\n```\n\nSee detailed documentation below for each feature.\n\n## Routes\n\n### Array Resources\n\nFor array resources like `posts` and `comments`:\n\n```http\nGET    \u002Fposts\nGET    \u002Fposts\u002F:id\nPOST   \u002Fposts\nPUT    \u002Fposts\u002F:id\nPATCH  \u002Fposts\u002F:id\nDELETE \u002Fposts\u002F:id\n```\n\n### Object Resources\n\nFor singular object resources like `profile`:\n\n```http\nGET   \u002Fprofile\nPUT   \u002Fprofile\nPATCH \u002Fprofile\n```\n\n## Query params\n\n### Conditions\n\nUse `field:operator=value`.\n\nOperators:\n\n- no operator -> `eq` (equal)\n- `lt` less than, `lte` less than or equal\n- `gt` greater than, `gte` greater than or equal\n- `eq` equal, `ne` not equal\n- `in` included in comma-separated list\n- `contains` string contains (case-insensitive)\n- `startsWith` string starts with (case-insensitive)\n- `endsWith` string ends with (case-insensitive)\n\nExamples:\n\n```http\nGET \u002Fposts?views:gt=100\nGET \u002Fposts?title:eq=Hello\nGET \u002Fposts?id:in=1,2,3\nGET \u002Fposts?author.name:eq=typicode\nGET \u002Fposts?title:contains=hello\nGET \u002Fposts?title:startsWith=Hello\nGET \u002Fposts?title:endsWith=world\n```\n\n### Sort\n\n```http\nGET \u002Fposts?_sort=title\nGET \u002Fposts?_sort=-views\nGET \u002Fposts?_sort=author.name,-views\n```\n\n### Pagination\n\n```http\nGET \u002Fposts?_page=1&_per_page=25\n```\n\n**Response:**\n```json\n{\n  \"first\": 1,\n  \"prev\": null,\n  \"next\": 2,\n  \"last\": 4,\n  \"pages\": 4,\n  \"items\": 100,\n  \"data\": [\n    { \"id\": \"1\", \"title\": \"...\", \"views\": 100 },\n    { \"id\": \"2\", \"title\": \"...\", \"views\": 200 }\n  ]\n}\n```\n\n**Notes:**\n- `_per_page` defaults to `10` if not specified\n- Invalid `_page` or `_per_page` values are automatically normalized to valid ranges\n\n### Embed\n\n```http\nGET \u002Fposts?_embed=comments\nGET \u002Fcomments?_embed=post\n```\n\n### Complex filter with `_where`\n\n`_where` accepts a JSON object and overrides normal query params when valid.\n\n```http\nGET \u002Fposts?_where={\"or\":[{\"views\":{\"gt\":100}},{\"author\":{\"name\":{\"lt\":\"m\"}}}]}\n```\n\n## Delete dependents\n\n```http\nDELETE \u002Fposts\u002F1?_dependent=comments\n```\n\n## Static Files\n\nJSON Server automatically serves files from the `.\u002Fpublic` directory.\n\nTo serve additional static directories:\n\n```bash\njson-server db.json -s .\u002Fstatic\njson-server db.json -s .\u002Fstatic -s .\u002Fnode_modules\n```\n\nStatic files are served with standard MIME types and can include HTML, CSS, JavaScript, images, and other assets.\n\n## Migration Notes (v0 → v1)\n\nIf you are upgrading from json-server v0.x, note these behavioral changes:\n\n- **ID handling:** `id` is always a string and will be auto-generated if not provided\n- **Pagination:** Use `_per_page` with `_page` instead of the deprecated `_limit` parameter\n- **Relationships:** Use `_embed` instead of `_expand` for including related resources\n- **Request delays:** Use browser DevTools (Network tab > throttling) instead of the removed `--delay` CLI option\n\n> **New to json-server?** These notes are for users migrating from v0. If this is your first time using json-server, you can ignore this section.\n","JSON-Server 是一个能够快速生成伪造 REST API 的工具，无需编写任何代码即可在30秒内启动。它允许开发者通过简单的 JSON 文件定义数据结构，并自动生成相应的 CRUD 接口。该项目基于 Node.js 平台，使用 JavaScript 语言开发，支持 JSON 和 JSON5 格式的数据源。其核心功能包括提供了一个易于使用的命令行界面来启动服务，以及丰富的配置选项以满足不同的需求。JSON-Server 特别适合于前端开发人员在后端API尚未完成时进行原型设计、测试或学习用途，同时也适用于需要快速搭建模拟环境的教学场景。","2026-06-17 02:35:31","top_all"]