{"id":27127796,"url":"https://github.com/ananto30/gmocker","last_synced_at":"2025-04-07T17:57:59.067Z","repository":{"id":43000943,"uuid":"368453051","full_name":"Ananto30/gmocker","owner":"Ananto30","description":"Create a blazing fast mock server with just a JSON file","archived":false,"fork":false,"pushed_at":"2024-06-24T06:15:32.000Z","size":14766,"stargazers_count":55,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T04:36:32.290Z","etag":null,"topics":["fasthttp","go","golang","mock-server"],"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/Ananto30.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-05-18T08:17:44.000Z","updated_at":"2024-08-23T22:21:14.000Z","dependencies_parsed_at":"2023-02-10T02:16:01.646Z","dependency_job_id":"5c2b214a-7e0e-4b0e-88ef-48e65c604190","html_url":"https://github.com/Ananto30/gmocker","commit_stats":null,"previous_names":["ananto30/mocker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ananto30%2Fgmocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ananto30%2Fgmocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ananto30%2Fgmocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ananto30%2Fgmocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ananto30","download_url":"https://codeload.github.com/Ananto30/gmocker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704511,"owners_count":20982293,"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":["fasthttp","go","golang","mock-server"],"created_at":"2025-04-07T17:57:58.437Z","updated_at":"2025-04-07T17:57:59.056Z","avatar_url":"https://github.com/Ananto30.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gmocker\n[![codecov](https://codecov.io/gh/Ananto30/gmocker/branch/main/graph/badge.svg?token=ulDcbeJyak)](https://codecov.io/gh/Ananto30/gmocker)\n[![Maintainability](https://api.codeclimate.com/v1/badges/8d035908151fad8489ee/maintainability)](https://codeclimate.com/github/Ananto30/mocker/maintainability)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Ananto30/mocker)](https://goreportcard.com/report/github.com/Ananto30/mocker)\n\nRun a blazing fast mock server in just seconds! 🚀\n\nAll you need is to make a json file that contains path and response mapping. See an example [here](https://github.com/Ananto30/mocker#sample-mockjson-file).\n\n*Only json is supported for now, please create issues for bugs and new features.*\n\n## Run\nWith defaults - \n```bash\n./mocker\n```\n**Defaults: `addr=localhost:7070` , `file=mock.json`**\n\n\nWith custom flags - \n```bash\n./mocker -addr \u003cYOUR_HOST_AND_PORT\u003e -file \u003cMOCK_JSON_FILE_LOCATION\u003e\n```\n\n\nFor windows - \n```powershell\nmocker.exe -addr \u003cYOUR_HOST_AND_PORT\u003e -file \u003cMOCK_JSON_FILE_LOCATION\u003e\n```\n\n## Sample mock.json file\n```\n{\n  \"\u003cYOUR_PATH\u003e\": {\n    \"statusCode\": \u003cINTEGER\u003e,\n    \"responseBody\": {\n      \u003cYOUR_RESPONSE_BODY\u003e ...\n    }\n  }\n}\n```\nThese `path`s will be matched and the json will be sent. \n\nExample - \n```json\n{\n  \"/hello/worlds\": {\n    \"statusCode\": 200,\n    \"responseBody\": {\n      \"message\": \"Hello worlds!\",\n      \"data\" : {\n        \"time\": \"now\"\n      },\n      \"worlds\": [\n        \"cross origin world\",\n        \"mars world\",\n        \"moon world\"\n      ]\n    }\n  }\n}\n```\nIf a request lands in the server in path `/hello/worlds` the json object inside `responseBody` will be sent as response.\n\n**The request type [POST or GET] doesn't matter.**\n\n## Build\nFor mac/linux - \n```bash\ngo mod download\ngo build\n```\n\nFor windows -\n```bash\ngo mod download\nGOOS=windows GOARCH=amd64 go build \n```\n\n**If the build/binary doesn't work for you, you can do this -\n\n- Check your os and arch using this command - `go env GOOS GOARCH`\n- Use the output os and arch to build the binary - `GOOS=\u003cYOUR_OS\u003e GOARCH=\u003cYOUR_ARCH\u003e go build`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananto30%2Fgmocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fananto30%2Fgmocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananto30%2Fgmocker/lists"}