{"id":13452424,"url":"https://github.com/clue/docker-json-server","last_synced_at":"2025-04-07T12:06:15.346Z","repository":{"id":21952928,"uuid":"25277488","full_name":"clue/docker-json-server","owner":"clue","description":"JSON Server docker image, REST API mocking based on plain JSON","archived":false,"fork":false,"pushed_at":"2020-06-18T06:40:18.000Z","size":130,"stargazers_count":313,"open_issues_count":15,"forks_count":135,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-31T10:11:11.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-15T23:11:34.000Z","updated_at":"2025-03-23T17:45:11.000Z","dependencies_parsed_at":"2022-08-20T15:30:29.617Z","dependency_job_id":null,"html_url":"https://github.com/clue/docker-json-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clue%2Fdocker-json-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clue%2Fdocker-json-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clue%2Fdocker-json-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clue%2Fdocker-json-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clue","download_url":"https://codeload.github.com/clue/docker-json-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"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":[],"created_at":"2024-07-31T07:01:23.812Z","updated_at":"2025-04-07T12:06:15.321Z","avatar_url":"https://github.com/clue.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# docker-json-server\n\n[JSON Server](https://github.com/typicode/json-server) provides REST API mocking based on plain JSON.\nThis is a [docker](https://www.docker.io) image that eases setup.\n\n## Usage\n\nThis docker image is available as a [trusted build on the docker index](https://index.docker.io/u/clue/json-server/),\nso there's no setup required.\nUsing this image for the first time will start a download automatically.\nFurther runs will be immediate, as the image will be cached locally.\n\nThe recommended way to run this container looks like this:\n\n```bash\n$ docker run -d -p 80:80 -v /home/user/articles.json:/data/db.json clue/json-server\n```\n\nThe above example exposes the JSON Server REST API on port 80, so that you can now browse to:\n\n```\nhttp://localhost/\n```\n\nThis is a rather common setup following docker's conventions:\n\n* `-d` will run a detached instance in the background\n* `-p {OutsidePort}:80` will bind the webserver to the given outside port\n* `-v {AbsolutePathToJsonFile}:/data/db.json` should be passed to mount the given JSON file into the container\n* `clue/json-server` the name of this docker image\n\n### Help\n\nYou can supply any number of JSON Server arguments that will be passed through unmodified.\n\n```bash\n$ docker run -it --rm clue/json-server --help\n```\n\n### JSON source\n\nIf you mount a file to `/data/db.json` (as in the above example),\nit will automatically be used as the plain JSON data source file.\n\nA sample file could look like this:\n\n```json\n{\n  \"posts\": [\n    { \"id\": 1, \"body\": \"foo\" },\n    { \"id\": 2, \"body\": \"bar\" }\n  ],\n  \"comments\": [\n    { \"id\": 1, \"body\": \"baz\", \"postId\": 1 },\n    { \"id\": 2, \"body\": \"qux\", \"postId\": 2 }\n  ]\n}\n```\n\n### JS seed file\n\nIf you mount a file to `/data/file.js`,\nit will automatically be used as a JS seed file.\n\nJSON Server expects JS files to export a function that returns an object.\nSeed files are useful if you need to programmaticaly create a lot of data.\n\nA sample file could look like this:\n\n```javascript\nmodule.exports = function() {\n  var data = {};\n\n  data.posts = [];\n  data.posts.push({ id: 1, body: 'foo' });\n  //...\n\n  return data;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclue%2Fdocker-json-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclue%2Fdocker-json-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclue%2Fdocker-json-server/lists"}