{"id":19265493,"url":"https://github.com/sbeator/mock-server","last_synced_at":"2026-03-01T03:02:38.826Z","repository":{"id":72911664,"uuid":"137450726","full_name":"SBeator/mock-server","owner":"SBeator","description":"A mock server for homework","archived":false,"fork":false,"pushed_at":"2018-06-19T06:53:40.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T19:18:33.664Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/SBeator.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-15T06:42:01.000Z","updated_at":"2018-07-17T15:44:28.000Z","dependencies_parsed_at":"2023-05-26T01:15:11.258Z","dependency_job_id":null,"html_url":"https://github.com/SBeator/mock-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SBeator/mock-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SBeator%2Fmock-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SBeator%2Fmock-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SBeator%2Fmock-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SBeator%2Fmock-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SBeator","download_url":"https://codeload.github.com/SBeator/mock-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SBeator%2Fmock-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29959284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-11-09T19:46:13.152Z","updated_at":"2026-03-01T03:02:38.790Z","avatar_url":"https://github.com/SBeator.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Home work mock server\n\nThis mock server is built by [json-server](https://github.com/typicode/json-server). All the mocked data are put in file `db.json`. \n\nPlease use this mock server as the back end server of your homework. You can use this project as mock server directly, or you can integrate this mock server into your own project. \n\nOf course, if you think anything in this mock server is not OK for you, you can absolutely change this server to help you finish your homework.\n\n## Start mock server\n\nPlease clone or download this project to your local, and use `npm` or `yarn` to install the dependences and start server:\n\n```\nnpm install\nnpm start\n```\n\nOr\n\n```\nyarn install\nyarn start\n```\n\nThen you can access `http://localhost:3001/agents/` to see if the server is started correctly.\n\n## APIs\n\nYou can refer the document of [json-server](https://github.com/typicode/json-server) to see the full APIs. \n\nAlso here are some APIs you might want to use:\n\n### Get agents list\n\n```\nGET http://localhost:3001/agents\n```\n\nThe response of this request would be the json of all agents list.\n\n### Get one agent\n\n```\nGET http://localhost:3001/agents/{id}\n```\n\nThe response of this request would be the json of the agent which match the id.\n\n### Change one agent\n\n```\nPUT http://localhost:3001/agents/{id}\n{\n    \"headers\": {\n        \"Content-Type\": \"application/json\"\n    },\n    \"body\": {MODIFIED AGENT}\n}\n```\n\nThe `body` parameter is a json of the modified agent, here is an example:\n\n```\n\"body\": {\n      \"name\": \"bjstdmngbdr10.thoughtworks.com\",\n      \"os\": \"ubuntu\",\n      \"status\": \"building\",\n      \"type\": \"physical\",\n      \"ip\": \"192.168.1.117\",\n      \"location\": \"/var/lib/cruise-agent\",\n      \"resources\": [\n        \"Firefox\",\n        \"Safari\"\n      ],\n      \"id\": 3\n    }\n```\n\nThen the agent which match which the id will be updated and be replaced with the modified agent. \n\nThe response of this request would be the json of the modified agent.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbeator%2Fmock-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbeator%2Fmock-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbeator%2Fmock-server/lists"}