{"id":13394403,"url":"https://github.com/typicode/json-server","last_synced_at":"2026-01-21T01:00:34.994Z","repository":{"id":12153776,"uuid":"14747598","full_name":"typicode/json-server","owner":"typicode","description":"Get a full fake REST API with zero coding in less than 30 seconds (seriously)","archived":false,"fork":false,"pushed_at":"2025-11-21T14:13:39.000Z","size":4535,"stargazers_count":75540,"open_issues_count":723,"forks_count":7266,"subscribers_count":998,"default_branch":"main","last_synced_at":"2026-01-11T09:28:45.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typicode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"typicode"}},"created_at":"2013-11-27T13:21:13.000Z","updated_at":"2026-01-11T09:09:20.000Z","dependencies_parsed_at":"2024-04-22T18:46:30.864Z","dependency_job_id":"5d20c1a1-b0b6-4cbf-a31e-6f7a50ea0c7a","html_url":"https://github.com/typicode/json-server","commit_stats":{"total_commits":893,"total_committers":87,"mean_commits":"10.264367816091953","dds":"0.13437849944008962","last_synced_commit":"64a9477c1d891a8db2ca0d51176d0ed6a77c1dbe"},"previous_names":[],"tags_count":156,"template":false,"template_full_name":null,"purl":"pkg:github/typicode/json-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fjson-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fjson-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fjson-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fjson-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typicode","download_url":"https://codeload.github.com/typicode/json-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fjson-server/sbom","scorecard":{"id":905495,"data":{"date":"2025-08-11","repo":{"name":"github.com/typicode/json-server","commit":"6d38bc118c53d02dd9ece9d70afdd53800dc6776"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/typicode/json-server/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/typicode/json-server/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/typicode/json-server/npm-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/typicode/json-server/npm-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/typicode/json-server/npm-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/typicode/json-server/npm-publish.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   3 out of   3 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/npm-publish.yml:11","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-7q7g-4xm8-89cq","Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T17:12:48.540Z","repository_id":12153776,"created_at":"2025-08-24T17:12:48.540Z","updated_at":"2025-08-24T17:12:48.540Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28620572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"ssl_error","status_checked_at":"2026-01-20T23:47:29.996Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T17:01:18.291Z","updated_at":"2026-01-21T01:00:34.916Z","avatar_url":"https://github.com/typicode.png","language":"JavaScript","readme":"# JSON-Server\n\n[![Node.js CI](https://github.com/typicode/json-server/actions/workflows/node.js.yml/badge.svg)](https://github.com/typicode/json-server/actions/workflows/node.js.yml)\n\n\u003e [!IMPORTANT]\n\u003e Viewing beta v1 documentation – usable but expect breaking changes. For stable version, see [here](https://github.com/typicode/json-server/tree/v0)\n\n\u003e [!NOTE]\n\u003e Using React ⚛️ ? Check my new project [MistCSS](https://github.com/typicode/mistcss) to write type-safe styles (works with TailwindCSS)\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  \"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\u003e\n\n\u003csummary\u003eView db.json5 example\u003c/summary\u003e\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://github.com/json5/json5).\n\n\u003c/details\u003e\n\nPass it to JSON Server CLI\n\n```shell\n$ npx json-server db.json\n```\n\nGet a REST API\n\n```shell\n$ curl http://localhost:3000/posts/1\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://mockend.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://jsonplaceholder.typicode.com/mockend.svg\" height=\"100px\"\u003e\u003c/a\u003e               |\n| \u003ca href=\"https://zuplo.link/json-server-gh\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/adfee31f-a8b6-4684-9a9b-af4f03ac5b75\" height=\"100px\"\u003e\u003c/a\u003e |\n|     \u003ca href=\"https://www.mintlify.com/\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/bcc8cc48-b2d9-4577-8939-1eb4196b7cc5\" height=\"100px\"\u003e\u003c/a\u003e     |\n\n### Silver\n\n|                                                                                                                                                                                                                                         |\n| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |\n| \u003ca href=\"https://requestly.com?utm_source=githubsponsor\u0026utm_medium=jsonserver\u0026utm_campaign=jsonserver\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/f7e7b3cf-97e2-46b8-81c8-cb3992662a1c\" style=\"height:70px; width:auto;\"\u003e\u003c/a\u003e |\n\n### Bronze\n\n|                                                                                                                                                                                |                                                                                                                                                                              |\n| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |\n| \u003ca href=\"https://www.storyblok.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/typicode/json-server/assets/5502029/c6b10674-4ada-4616-91b8-59d30046b45a\" height=\"35px\"\u003e\u003c/a\u003e | \u003ca href=\"https://betterstack.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/typicode/json-server/assets/5502029/44679f8f-9671-470d-b77e-26d90b90cbdc\" height=\"35px\"\u003e\u003c/a\u003e |\n\n[Become a sponsor and have your company logo here](https://github.com/users/typicode/sponsorship)\n\n## Sponsorware\n\n\u003e [!NOTE]\n\u003e This project uses the [Fair Source License](https://fair.io/). Only organizations with 3+ users are kindly asked to contribute a small amount through sponsorship [sponsor](https://github.com/sponsors/typicode) for usage. **This license helps keep the project sustainable and healthy, benefiting everyone.**\n\u003e\n\u003e For more information, FAQs, and the rationale behind this, visit [https://fair.io/](https://fair.io/).\n\n## Routes\n\nBased on the example `db.json`, you'll get the following routes:\n\n```\nGET    /posts\nGET    /posts/:id\nPOST   /posts\nPUT    /posts/:id\nPATCH  /posts/:id\nDELETE /posts/:id\n\n# Same for comments\n```\n\n```\nGET   /profile\nPUT   /profile\nPATCH /profile\n```\n\n## Params\n\n### Conditions\n\n- ` ` → `==`\n- `lt` → `\u003c`\n- `lte` → `\u003c=`\n- `gt` → `\u003e`\n- `gte` → `\u003e=`\n- `ne` → `!=`\n\n```\nGET /posts?views_gt=9000\n```\n\n### Range\n\n- `start`\n- `end`\n- `limit`\n\n```\nGET /posts?_start=10\u0026_end=20\nGET /posts?_start=10\u0026_limit=10\n```\n\n### Paginate\n\n- `page`\n- `per_page` (default = 10)\n\n```\nGET /posts?_page=1\u0026_per_page=25\n```\n\n### Sort\n\n- `_sort=f1,f2`\n\n```\nGET /posts?_sort=id,-views\n```\n\n### Nested and array fields\n\n- `x.y.z...`\n- `x.y.z[i]...`\n\n```\nGET /foo?a.b=bar\nGET /foo?x.y_lt=100\nGET /foo?arr[0]=bar\n```\n\n### Embed\n\n```\nGET /posts?_embed=comments\nGET /comments?_embed=post\n```\n\n## Delete\n\n```\nDELETE /posts/1\nDELETE /posts/1?_dependent=comments\n```\n\n## Serving static files\n\nIf you create a `./public` directory, JSON Server will serve its content in addition to the REST API.\n\nYou can also add custom directories using `-s/--static` option.\n\n```sh\njson-server -s ./static\njson-server -s ./static -s ./node_modules\n```\n\n## Notable differences with v0.17\n\n- `id` is always a string and will be generated for you if missing\n- use `_per_page` with `_page` instead of `_limit`for pagination\n- use Chrome's `Network tab \u003e throtling` to delay requests instead of `--delay` CLI option\n","funding_links":["https://github.com/sponsors/typicode"],"categories":["JavaScript","Open source and free HTTP mocking, stubbing and service virtualisation tools to speed up your development and testing","API Debugging and Mocking","Create your database","How to Run","Test Data \u0026 Mocking","JavaScript Libraries, Tools, and Reference","Repository","others","Databases","Testing","Uncategorized","HTTP Frameworks","js库(Browser/Nodejs)","API Development","Placeholder APIs","Developers","在線使用","Tools","网络服务","Debugging","GIT 仓库","Test tools","Node.js","Mock Servers","Layout","命令行工具","前端常用","2. 调试工具","Command line - Linux"],"sub_categories":["Desktop",".NET","Miscellaneous Libraries","HTTP","Mocking","Uncategorized","Self-hosted","Markdown","网络服务_其他","HTTP Debugging","React Components","Server","Scroll","24.3 Web Sockets","Learning resources"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypicode%2Fjson-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypicode%2Fjson-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypicode%2Fjson-server/lists"}