{"id":14991395,"url":"https://github.com/couriourc/mock_server","last_synced_at":"2025-10-09T10:40:27.472Z","repository":{"id":255774963,"uuid":"853076594","full_name":"couriourc/mock_server","owner":"couriourc","description":"Simple Mock JSON Server","archived":false,"fork":false,"pushed_at":"2024-09-15T02:30:27.000Z","size":229,"stargazers_count":74,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T02:51:10.418Z","etag":null,"topics":["bun","cli","elysiajs","mock","mustache","server","simple"],"latest_commit_sha":null,"homepage":"https://couriourc.github.io","language":"TypeScript","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/couriourc.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":"2024-09-06T00:18:32.000Z","updated_at":"2025-02-26T03:54:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"91a0153b-5dd1-4e8f-9e70-cf12834cfa3c","html_url":"https://github.com/couriourc/mock_server","commit_stats":{"total_commits":49,"total_committers":3,"mean_commits":"16.333333333333332","dds":0.3877551020408163,"last_synced_commit":"a51a8b91e8ea72eda1e31c426f240ff3516fea43"},"previous_names":["couriourc/mock_server"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/couriourc/mock_server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couriourc%2Fmock_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couriourc%2Fmock_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couriourc%2Fmock_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couriourc%2Fmock_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/couriourc","download_url":"https://codeload.github.com/couriourc/mock_server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couriourc%2Fmock_server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001277,"owners_count":26083040,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":["bun","cli","elysiajs","mock","mustache","server","simple"],"created_at":"2024-09-24T14:27:41.705Z","updated_at":"2025-10-09T10:40:27.444Z","avatar_url":"https://github.com/couriourc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## SimpleMockServer\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://ruffle.rs\"\u003e\u003cimg src=\"./docs/logo.jpg\" style=\"margin: 0 auto;border-radius: 20px;\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cbr /\u003e\n  \u003cstrong\u003e\n    \u003ca href=\"./example\"\u003eDemo\u003c/a\u003e |\n    \u003ca href=\"https://github.com/couriourc/mock_server/releases\"\u003enightly builds\u003c/a\u003e | \n    \u003ca href=\"https://github.com/couriourc/mock_server/example\"\u003eExample\u003c/a\u003e | \n    \u003ca href=\"https://github.com/couriourc/mock_server/wiki\"\u003ewiki\u003c/a\u003e\n  \u003c/strong\u003e\n\u003c/p\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n  \n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/couriourc/mock_server/Builder?label=build\u0026style=flat-square)\n[![Node version](https://img.shields.io/node/v/@couriourc/simple-mock.svg?style=flat)](https://www.npmjs.com/package/@couriourc/simple-mock)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/couriourc/simple-mock_server/issues)\n\n\u003c/div\u003e\n\n## Introduction\n\nThere is a most simple mock server use file organization, just drag your file, and rm your filename,and u got a\nserver;\n\n## Direct use\n\n[Download the bin version -\u003e](https://github.com/couriourc/mock_server/releases/tag/release)\n\nstartup your download application,and it will auto create directories named `static`,`apis`, and then will start a\nserver,\nPlace the folder that requires Mock in the apis directory, and then start the service, where the api rule is, the\ndirectory determines the prefix,`[api_suffix]. [api_method]\n.json`, where api_suffix represents the api path, api_method represents the interception method, and\nsupports `get| post| patch| head| delete| option| put`\n, this is just to keep the results consistent. Index.json is automatically intercepted here as`/`.\n\n## Features\n\n- Returns static JSON data\n- Returns based on interface information\n- Generated based on the Mock template, see http://mockjs.com/examples.html\n  Here, a {{}} writing similar to Vue is supported, and the replaced result is converted using Mockjs, which means that\n  random data is generated through json. We provided the 'cookie', 'user-agent', 'headers', 'body', 'route', 'query', '\n  content-type',just like {{headers.contentType}} or {{query.key1}}\n\n## Example\n\n```txt\nPS D:\\projects\\mock_server\u003e tree .\\example\\ /f\n│  .simple-mock.yaml\n│  [SimpleMockServer] your download application\n├─apis\n│  └─api\n│      │  index.delete.json\n│      │  index.get.json\n│      │  index.json\n│      │  index.option.json\n│      │  index.patch.json\n│      │  index.post.json\n│      │  querybyentity.json\n│      │\n│      └─index\n│              test.json\n│\n├─plugins\n│  └─peer-stream\n│      │  index.js\n│      │  package.json\n│      │  pnpm-lock.yaml\n│      └─node_modules\n└─static\n        bootstrap.min.css\n        index.html\n        jquery.min.js\n        normalize.css\n\n```\n\n```txt\n┌───────┬───────────────────┬────────┬─────────────────────────────┐\n│ index │ url               │ method │ file                        │\n├───────┼───────────────────┼────────┼─────────────────────────────┤\n│     1 │ api/              │ delete │ apis\\api\\index.delete.json  │\n│     2 │ api/              │ get    │ apis\\api\\index.get.json     │\n│     3 │ api/              │ get    │ apis\\api\\index.json         │\n│     4 │ api/              │ option │ apis\\api\\index.option.json  │\n│     5 │ api/              │ patch  │ apis\\api\\index.patch.json   │\n│     6 │ api/              │ post   │ apis\\api\\index.post.json    │\n│     7 │ api/querybyentity │ get    │ apis\\api\\querybyentity.json │\n│     8 │ api/index/test    │ get    │ apis\\api\\index\\test.json    │\n└───────┴───────────────────┴────────┴─────────────────────────────┘\n```\n\nand you can fetch `/api` to access content of `apis\\api\\index.delete.json`\n\n## Plugins\n\nWe also offer a plugin system to extend it, I am writing wiki\n### Swagger\nThe Swagger plugin is pre-installed in the project and can be seen directly by visiting /swagger.\n![image](https://github.com/user-attachments/assets/9ca5ce8b-f113-4193-a991-28054d4341ff)\n\n\u003e  ❤️ Many thanks to Elysia for the handy and nice ui . https://github.com/elysiajs/elysia-swagger\n\n### Cors\nHandles cross-domain issues and can give XHR direct access to Mock's APIs\n\nall of plugins can configuration by set field `plugins` of `.simple_mock.yaml` \n\n```diff\n\nroot_dir: .\napi_dir: apis\nstatic_dir: static\nstatic_route_prefix: /\nport: 3000\nsilent:\nerror_log_file_path: ./error.log\nlog_size: 10M\ndebug_log_file_path: ./debug.log\nwatch:\n+ plugins:\n+  swagger:\n+  cors: \n  \nrewrites:\n  - path: ''\n    test: ^(index)$\n\n```\n\n## Configuration\n\nPlease see [ source code ](https://github.com/couriourc/mock_server),[WIP]\n\n## Check list\n\n- [ x ] Plugin Loaded\n- [ x ] Support Static HTML to deploy\n- [ x ] Mock JSON by filename\n- [ ] WIKI\n\n## Thank You!\nHelp spread the Code Quality Love! ❤️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouriourc%2Fmock_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcouriourc%2Fmock_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouriourc%2Fmock_server/lists"}