{"id":37108002,"url":"https://github.com/hudymi/mockice","last_synced_at":"2026-01-14T12:58:15.561Z","repository":{"id":64304163,"uuid":"206612280","full_name":"hudymi/mockice","owner":"hudymi","description":"Lightweight HTTP service that provides configurable endpoints","archived":false,"fork":false,"pushed_at":"2021-10-23T20:42:00.000Z","size":39,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T13:40:22.386Z","etag":null,"topics":["go","golang","http","mock","rest","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hudymi.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}},"created_at":"2019-09-05T16:43:49.000Z","updated_at":"2021-10-23T20:42:51.000Z","dependencies_parsed_at":"2023-01-15T10:15:19.506Z","dependency_job_id":null,"html_url":"https://github.com/hudymi/mockice","commit_stats":null,"previous_names":["michal-hudy/mockice"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/hudymi/mockice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudymi%2Fmockice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudymi%2Fmockice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudymi%2Fmockice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudymi%2Fmockice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hudymi","download_url":"https://codeload.github.com/hudymi/mockice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hudymi%2Fmockice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","golang","http","mock","rest","testing"],"created_at":"2026-01-14T12:58:14.870Z","updated_at":"2026-01-14T12:58:15.556Z","avatar_url":"https://github.com/hudymi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mockice\n\n\n[![CI](https://github.com/hudymi/mockice/workflows/build/badge.svg?branch=master)](https://github.com/hudymi/mockice/actions?query=branch:master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hudymi/mockice/actions)](https://goreportcard.com/report/github.com/hudymi/mockice/actions)\n\nMockice is a simple HTTP service that provides configurable endpoints. Use it for testing or serving static content.\n\n## Installation\n\nTo install Mockice, run:\n\n```bash\ngo get -u -v github.com/hudymi/mockice\n```\n\n## Usage\n\nTo use Mockice, you can run its latest version, run its latest Docker image, or run it from sources. In each case, by default, the service listens on port `8080` and has one endpoint - `http://localhost:8080/hello`.\n\n### Run the latest version\n\nTo run Mockice latest version, install Mockice with the command from the [Installation](#Installation) section and run:\n\n```bash\nmockice --verbose\n```\n\n### Run a Docker image\n\nTo run Mockice latest Docker image, use the following command:\n\n```bash\ndocker run -p 8080:8080 hudymi/mockice:latest --verbose\n```\n\n### Run from sources\n\nTo run Mockice from sources, use the following command:\n\n```bash\nGO111MODULE=on go run main.go --verbose\n```\n\n### Command line parameters\n\nThe table contains the command line parameters available for the service:\n\n| Name | Description | Default Value |\n| ---- | ----------- | ------------- |\n| `--config` | A path to the configuration file. If not provided, the default configuration is used. | |\n| `--verbose` | Enables verbose logging. | `false` |\n\n## Configuration\n\nBy default, in every interface Mockice listens on port `8080` and has one endpoint - `http://localhost:8080/hello`. If you provide any configuration, the default endpoint is disabled.\n\nThe configuration file must be in the `yaml` format. See the [config](main.go) structure for the up-to-date list of the available fields.\n\n### File structure\n\n```yaml\n# The service address\naddress: :8080\n# The list of endpoints\nendpoints:\n- name: hello # Name of the endpoint\n  # The list of valid methods, if not set validation is skipped\n  methods:\n  - GET\n  - POST\n  # Default HTTP response code, if not provided 200\n  defaultResponseCode: 200\n  # Default response content\n  defaultResponseContent: \"Sample service\"  \n  # Default response content-type, if not provided \"text/plain; charset=utf-8\"\n  defaultResponseContentType: text/plain; charset=utf-8\n  # Path to the file that is returned by default, if provided then defaultResponseContent is ignored\n  defaultResponseFile: \"mockice/index.html\"\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhudymi%2Fmockice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhudymi%2Fmockice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhudymi%2Fmockice/lists"}