{"id":16054671,"url":"https://github.com/nejdetkadir/json-server-clone","last_synced_at":"2025-03-17T10:11:12.539Z","repository":{"id":132709415,"uuid":"334321153","full_name":"nejdetkadir/json-server-clone","owner":"nejdetkadir","description":"Create a server and serve content of your json files in localhost","archived":false,"fork":false,"pushed_at":"2021-01-30T19:03:58.000Z","size":121,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T19:38:44.345Z","etag":null,"topics":["json-api","json-server","rest-api","restful-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/nejdetkadir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2021-01-30T03:42:58.000Z","updated_at":"2023-01-29T17:16:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"791cb00a-0869-4b80-9b82-e967f7a6ec67","html_url":"https://github.com/nejdetkadir/json-server-clone","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.33333333333333337","last_synced_commit":"66e020f4ab6ef7a0897241692baf426ea0004938"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nejdetkadir%2Fjson-server-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nejdetkadir%2Fjson-server-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nejdetkadir%2Fjson-server-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nejdetkadir%2Fjson-server-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nejdetkadir","download_url":"https://codeload.github.com/nejdetkadir/json-server-clone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244014134,"owners_count":20383715,"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":["json-api","json-server","rest-api","restful-api"],"created_at":"2024-10-09T02:02:28.268Z","updated_at":"2025-03-17T10:11:12.508Z","avatar_url":"https://github.com/nejdetkadir.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON SERVER\nCreate a server and serve content of your json files in localhost\n![cover](doc/cover.gif)\n\n# Usage\nYou can use this command for just serve files with your specific port. You can use without port with this command. Port will be default defined as 5555\n```sh\n$ node index.js \u003cfile path\u003e --port=\u003cport\u003e\n```\nOutput:\n```sh\n[\n  { file: '\u003cfilename\u003e', url: 'http://localhost:\u003cport\u003e/\u003cfilename\u003e' },\n  port: \u003cport\u003e,\n  base_url: 'http://localhost:\u003cport\u003e',\n  server_status: 'online'\n]\n```\n\nIf you want to create REST API with zero coding, you can use watch command. Watch command supports only one file but supports specific port \n```sh\n$ node index.js --watch \u003cfile path\u003e --port=\u003cport\u003e\n```\nOutput:\n```sh\n[\n  {\n    description: 'List all \u003ctable name\u003e as JSON',\n    url: 'http://localhost:\u003cport\u003e/\u003ctable name\u003e'\n  },\n  {\n    description: 'Get single \u003ctable name\u003e with id as JSON',\n    url: 'http://localhost:\u003cport\u003e/\u003ctable name\u003e/:id'\n  },\n  data_table: '\u003ctable name\u003e',\n  port: \u003cport\u003e,\n  base_url: 'http://localhost:\u003cport\u003e',\n  server_status: 'online'\n]\n```\n\n# Examples\nYou can use without port with this command\n```sh\n$ node index.js api/data.json\n```\n\nOutput: \n```sh\n[\n  { file: 'data.json', url: 'http://localhost:5555/data' },\n  port: 5555,\n  base_url: 'http://localhost:5555',\n  server_status: 'online'\n]\n```\n\nYou can serve multiple JSON files with this command\n```sh\n$ node index.js api/foo.json api/bar.json\n```\n\nOutput:\n```sh\n[\n  { file: 'foo.json', url: 'http://localhost:5555/foo' },\n  { file: 'bar.json', url: 'http://localhost:5555/bar' },\n  port: 5555,\n  base_url: 'http://localhost:5555',\n  server_status: 'online'\n]\n```\n\nYou can serve JSON file like REST API with watch command. \n```sh\n$ node index.js --watch api/foo.json\n```\nOutput:\n```sh\n[\n  {\n    description: 'List all posts as JSON',\n    url: 'http://localhost:5555/posts'\n  },\n  {\n    description: 'Get single post with id as JSON',\n    url: 'http://localhost:5555/posts/:id'\n  },\n  data_table: 'posts',\n  port: 5555,\n  base_url: 'http://localhost:5555',\n  server_status: 'online'\n]\n```\n\n# LICENSE\n```\nMIT License\n\nCopyright (c) 2021 Nejdet Kadir Bektaş\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnejdetkadir%2Fjson-server-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnejdetkadir%2Fjson-server-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnejdetkadir%2Fjson-server-clone/lists"}