{"id":13582116,"url":"https://github.com/chanioxaris/json-server","last_synced_at":"2025-10-17T06:19:58.690Z","repository":{"id":44637208,"uuid":"276863269","full_name":"chanioxaris/json-server","owner":"chanioxaris","description":"Create a dummy REST API from a json file with zero coding in seconds","archived":false,"fork":false,"pushed_at":"2022-08-31T00:52:55.000Z","size":174,"stargazers_count":40,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-14T00:05:30.881Z","etag":null,"topics":["api","cross-platform","development","development-tools","golang","golang-library","golang-package","json","json-api","json-server","jsonapi","mock-server","rest","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chanioxaris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2020-07-03T09:39:02.000Z","updated_at":"2025-02-27T14:34:29.000Z","dependencies_parsed_at":"2022-09-04T13:51:24.947Z","dependency_job_id":null,"html_url":"https://github.com/chanioxaris/json-server","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanioxaris%2Fjson-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanioxaris%2Fjson-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanioxaris%2Fjson-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanioxaris%2Fjson-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chanioxaris","download_url":"https://codeload.github.com/chanioxaris/json-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246332086,"owners_count":20760408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","cross-platform","development","development-tools","golang","golang-library","golang-package","json","json-api","json-server","jsonapi","mock-server","rest","rest-api"],"created_at":"2024-08-01T15:02:26.149Z","updated_at":"2025-10-17T06:19:53.632Z","avatar_url":"https://github.com/chanioxaris.png","language":"Go","readme":"# JSON Server\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://raw.githubusercontent.com/chanioxaris/json-server/master/LICENSE)\n[![GoDoc](https://godoc.org/github.com/chanioxaris/json-server?status.svg)](https://godoc.org/github.com/chanioxaris/json-server)\n[![Release](https://img.shields.io/github/release/chanioxaris/json-server)](https://github.com/chanioxaris/json-server/releases/latest)\n\n[![codecov](https://codecov.io/gh/chanioxaris/json-server/branch/master/graph/badge.svg)](https://codecov.io/gh/chanioxaris/json-server)\n[![goreportcard](https://goreportcard.com/badge/github.com/chanioxaris/json-server)](https://goreportcard.com/report/github.com/chanioxaris/json-server)\n\nCreate a dummy REST API from a json file with zero coding in seconds. Helps you to continue\nyour development process when an API you depend on, doesn't exist or isn't complete yet. \n\nInspired from [json-server](https://github.com/typicode/json-server) javascript package.\n\n## Executables\nCross-platform (Windows, Linux, macOS) binaries are available for [download](https://github.com/chanioxaris/json-server/releases/latest). Select the executable that match your Operating System and run json-server without any dependencies, with \nminimum effort.\n\n## Getting started\nGet the package\n\n`go get github.com/chanioxaris/json-server`\n\nCreate a `db.json` file with your desired data\n\n    {\n      \"posts\": [\n        { \n           \"id\": \"1\", \n           \"title\": \"json-server\", \n           \"author\": \"chanioxaris\" \n        }\n      ],\n       \"books\": [\n         {\n           \"id\": \"1\",\n           \"title\": \"Clean Code\",\n           \"published\": 2008,\n           \"author\": \"Robert Martin\"\n         },\n         {\n           \"id\": \"2\",\n           \"title\": \"Crime and punishment\",\n           \"published\": 1866,\n           \"author\": \"Fyodor Dostoevsky\"\n         }\n       ]\n    }\n    \nStart JSON Server\n\n`go run main.go start`\n\nIf you navigate to http://localhost:3000/posts/1, you will get\n\n    { \n      \"id\": \"1\", \n      \"title\": \"json-server\", \n      \"author\": \"chanioxaris\" \n    }\n\n## Routes\nBased on the previous json file and for each resource, the below routes will be generated\n\n````\nGET     /\u003cresource\u003e\nGET     /\u003cresource\u003e/:id\nPOST    /\u003cresource\u003e\nPUT     /\u003cresource\u003e/:id\nPATCH   /\u003cresource\u003e/:id\nDELETE  /\u003cresource\u003e/:id\n````\n\nWhen doing requests, it's good to know that:\n- For POST requests any `id` value in the body will be honored, but only if not already taken.\n- For POST requests without `id` value in the body, a new one will be generated.\n- For PUT requests any `id` value in the body will be ignored, as id values are not mutable.\n- For PATCH requests any `id` value in the body will be ignored, as id values are not mutable.\n\n## Parameters\n- You can specify an alternative port with the flag `-p` or `--port`. Default value is `3000`.\n\n`go run main.go start -p 4000`\n\n- You can specify an alternative file with the flag `-f` or `--file`. Default value is `db.json`.\n\n`go run main.go start -f example.json`\n\n- You can toggle http request logs with the flag `-l` or `--logs`. Default value is `false`.\n\n`go run main.go start -l`\n\n## Known issues\n- For users running **macOS Catalina** and newer versions, apple will prevent binary from run as it hasn't been notarized \nand signed. To overcome this issue, you can [add a security exception](https://support.apple.com/en-us/HT202491) \nfor json-server.\n\n## Contributing\n\nContributions to this project are welcomed. For more information see the [contribution guidelines](CONTRIBUTING.md).\n\n## License\n\njson-server is [MIT licensed](LICENSE).","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanioxaris%2Fjson-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchanioxaris%2Fjson-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanioxaris%2Fjson-server/lists"}