{"id":13564041,"url":"https://github.com/smocker-dev/smocker","last_synced_at":"2026-01-12T00:57:36.738Z","repository":{"id":36415737,"uuid":"205148770","full_name":"smocker-dev/smocker","owner":"smocker-dev","description":"Smocker is a simple and efficient HTTP mock server and proxy","archived":false,"fork":false,"pushed_at":"2025-03-22T21:57:30.000Z","size":17333,"stargazers_count":1246,"open_issues_count":36,"forks_count":70,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-14T08:54:28.233Z","etag":null,"topics":["api","functional-testing","go","integration-testing","mock","mock-server","proxy","react","test","typescript"],"latest_commit_sha":null,"homepage":"https://smocker.dev","language":"TypeScript","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/smocker-dev.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":"2019-08-29T11:33:15.000Z","updated_at":"2025-05-09T01:55:46.000Z","dependencies_parsed_at":"2023-01-17T01:17:14.053Z","dependency_job_id":"f4561db9-676b-420c-a7f5-c0bdadeba387","html_url":"https://github.com/smocker-dev/smocker","commit_stats":{"total_commits":454,"total_committers":21,"mean_commits":21.61904761904762,"dds":0.7577092511013216,"last_synced_commit":"310c15349c41fa2941f3c3b6698ccfbb98607de0"},"previous_names":["thiht/smocker"],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smocker-dev%2Fsmocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smocker-dev%2Fsmocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smocker-dev%2Fsmocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smocker-dev%2Fsmocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smocker-dev","download_url":"https://codeload.github.com/smocker-dev/smocker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198452,"owners_count":22030964,"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":["api","functional-testing","go","integration-testing","mock","mock-server","proxy","react","test","typescript"],"created_at":"2024-08-01T13:01:25.874Z","updated_at":"2025-05-14T18:01:45.757Z","avatar_url":"https://github.com/smocker-dev.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"./docs/logo-horizontal.png\" alt=\"Smocker\" height=\"100\" title=\"Smocker logo by mandyellow\" /\u003e\n\u003c/h1\u003e\n\n[![CI](https://github.com/smocker-dev/smocker/actions/workflows/main.yml/badge.svg)](https://github.com/smocker-dev/smocker/actions/workflows/main.yml)\n[![Docker Repository](https://img.shields.io/badge/ghcr.io%2Fsmocker--dev%2Fsmocker-blue?logo=docker\u0026label=docker)](https://github.com/smocker-dev/smocker/pkgs/container/smocker)\n[![Github Release](https://img.shields.io/github/v/release/smocker-dev/smocker.svg?logo=github)](https://github.com/smocker-dev/smocker/releases/latest)\n[![Go Report Card](https://goreportcard.com/badge/github.com/smocker-dev/smocker)](https://goreportcard.com/report/github.com/smocker-dev/smocker)\n[![License](https://img.shields.io/github/license/smocker-dev/smocker?logo=open-source-initiative)](https://github.com/smocker-dev/smocker/blob/main/LICENSE)\n\n**Smocker** (server mock) is a simple and efficient HTTP mock server.\n\nThe documentation is available on [smocker.dev](https://smocker.dev).\n\n## Table of contents\n\n- [Installation](#installation)\n  - [With Docker](#with-docker)\n  - [Manual Deployment](#manual-deployment)\n  - [Healthcheck](#healthcheck)\n  - [User Interface](#user-interface)\n- [Usage](#usage)\n  - [Hello, World!](#hello-world)\n- [Development](#development)\n  - [Backend](#backend)\n  - [Frontend](#frontend)\n  - [Docker](#docker)\n  - [Caddy](#caddy)\n  - [HTTPS](#https)\n- [Authors](#authors)\n- [Contributors](#contributors)\n\n## Installation\n\n### With Docker\n\n```sh\ndocker run -d \\\n  --restart=always \\\n  -p 8080:8080 \\\n  -p 8081:8081 \\\n  --name smocker \\\n  ghcr.io/smocker-dev/smocker\n```\n\n### Manual Deployment\n\n```sh\n# This will be the deployment folder for the Smocker instance\nmkdir -p /opt/smocker \u0026\u0026 cd /opt/smocker\nwget -P /tmp https://github.com/smocker-dev/smocker/releases/latest/download/smocker.tar.gz\ntar xf /tmp/smocker.tar.gz\nnohup ./smocker -mock-server-listen-port=8080 -config-listen-port=8081 \u0026\n```\n\n### Healthcheck\n\n```sh\ncurl localhost:8081/version\n```\n\n### User Interface\n\nSmocker exposes a configuration user interface. You can access it in your web browser on http://localhost:8081/.\n\n![History](docs/screenshots/screenshot-history.png)\n\n![Mocks](docs/screenshots/screenshot-mocks.png)\n\n## Usage\n\nSmocker exposes two ports:\n\n- `8080` is the mock server port. It will expose the routes you register through the configuration port\n- `8081` is the configuration port. It's the port you will use to register new mocks. This port also exposes a user interface.\n\n### Hello, World!\n\nTo register a mock, you can use the YAML and the JSON formats. A basic mock might look like this:\n\n```yaml\n# helloworld.yml\n# This mock register two routes: GET /hello/world and GET /foo/bar\n- request:\n    # Note: the method could be omitted because GET is the default\n    method: GET\n    path: /hello/world\n  response:\n    # Note: the status could be omitted because 200 is the default\n    status: 200\n    headers:\n      Content-Type: application/json\n    body: \u003e\n      {\n        \"hello\": \"Hello, World!\"\n      }\n\n- request:\n    method: GET\n    path: /foo/bar\n  response:\n    status: 204\n```\n\nYou can then register it to the configuration server with the following command:\n\n```sh\ncurl -XPOST \\\n  --header \"Content-Type: application/x-yaml\" \\\n  --data-binary \"@helloworld.yml\" \\\n  localhost:8081/mocks\n```\n\nAfter your mock is registered, you can query the mock server on the specified route, so that it returns the expected response to you:\n\n```sh\n$ curl -i localhost:8080/hello/world\nHTTP/1.1 200 OK\nContent-Type: application/json\nDate: Thu, 05 Sep 2019 15:49:32 GMT\nContent-Length: 31\n\n{\n  \"hello\": \"Hello, World!\"\n}\n```\n\nTo cleanup the mock server without restarting it, you can execute the following command:\n\n```sh\ncurl -XPOST localhost:8081/reset\n```\n\nFor more advanced usage, please read the [project's documentation](https://smocker.dev).\n\n## Development\n\n### Backend\n\nThe backend is written in Go. You can use the following commands to manage the development lifecycle:\n\n- `make start`: start the backend in development mode, with live reload\n- `make build`, `make VERSION=xxx build`: compile the code and generate a binary\n- `make lint`: run static analysis on the code\n- `make format`: automatically format the backend code\n- `make test`: execute unit tests\n- `make test-integration`: execute integration tests\n\n### Frontend\n\nThe frontend is written with TypeScript and React. You can use the following commands to manage the development lifecycle:\n\n- `yarn install`: install the dependencies\n- `yarn start`: start the frontend in development mode, with live reload\n- `yarn build`: generate the transpiled and minified files and assets\n- `yarn lint`: run static analysis on the code\n- `yarn format`: automatically format the frontend code\n- `yarn test`: execute unit tests\n- `yarn test:watch`: execute unit tests, with live reload\n\n### Docker\n\nThe application can be packaged as a standalone Docker image. You can use the following commands to manage the development lifecycle:\n\n- `make build-docker`, `make VERSION=xxx build-docker`: build the application as a Docker image\n- `make start-docker`, `make VERSION=xxx start-docker`: run a Smocker Docker image\n\n### Caddy\n\nIf you need to test Smocker with a base path, you can use the Caddyfile provided in the repository ([Caddy v2](https://caddyserver.com/v2)):\n\n- `make start-release`, `make VERSION=xxx start-release`: create a released version of Smocker and launch it with `/smocker/` as base path\n- `make start-caddy`: start Caddy to make Smocker accessible at http://localhost:8082/smocker/\n\n### HTTPS\n\nIf you need to test Smocker with HTTPS enabled, the easiest way is to generate a locally signed certificate with [mkcert](https://github.com/FiloSottile/mkcert):\n\n```sh\n# Install the local certificate authority\nmkcert -install\n\n# Create a certificate for localhost\nmkcert -cert-file /tmp/cert.pem -key-file /tmp/key.pem localhost\n```\n\nThen, start Smocker with TLS enabled, using your generated certificate:\n\n```sh\n./smocker -mock-server-listen-port=44300 -config-listen-port=44301 -tls-enable -tls-cert-file=/tmp/cert.pem -tls-private-key-file=/tmp/key.pem\n```\n\n## Authors\n\n- [Thibaut Rousseau](https://github.com/Thiht)\n- [Gwendal Leclerc](https://github.com/gwleclerc)\n\n## Contributors\n\n- [Amanda Yoshiizumi (mandyellow)](https://github.com/mandyellow): thank you for your awesome logo!\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmocker-dev%2Fsmocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmocker-dev%2Fsmocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmocker-dev%2Fsmocker/lists"}