{"id":32191390,"url":"https://github.com/moclojer/moclojer","last_synced_at":"2025-10-22T01:39:41.251Z","repository":{"id":36987632,"uuid":"462693523","full_name":"moclojer/moclojer","owner":"moclojer","description":"Simple and efficient HTTP and Webscoket mock server with specification in yaml, edn or OpenAPI","archived":false,"fork":false,"pushed_at":"2025-10-13T15:20:51.000Z","size":789,"stargazers_count":127,"open_issues_count":13,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-22T01:39:26.040Z","etag":null,"topics":["api","api-mock","api-mocker","api-rest","clojure","edn","hacktoberfest","mock","mock-server","openapi","openapi3","swagger","swagger-api","swagger2","yaml"],"latest_commit_sha":null,"homepage":"https://docs.moclojer.com","language":"Clojure","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/moclojer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":"CLA.md"},"funding":{"open_collective":"moclojer","github":["avelino"]}},"created_at":"2022-02-23T10:49:57.000Z","updated_at":"2025-10-10T08:18:06.000Z","dependencies_parsed_at":"2024-01-08T09:33:54.601Z","dependency_job_id":"ad809a72-8a6d-4213-a18a-0204653ee3ca","html_url":"https://github.com/moclojer/moclojer","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/moclojer/moclojer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moclojer%2Fmoclojer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moclojer%2Fmoclojer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moclojer%2Fmoclojer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moclojer%2Fmoclojer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moclojer","download_url":"https://codeload.github.com/moclojer/moclojer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moclojer%2Fmoclojer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280365576,"owners_count":26318385,"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-21T02:00:06.614Z","response_time":58,"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":["api","api-mock","api-mocker","api-rest","clojure","edn","hacktoberfest","mock","mock-server","openapi","openapi3","swagger","swagger-api","swagger2","yaml"],"created_at":"2025-10-22T01:39:40.032Z","updated_at":"2025-10-22T01:39:41.239Z","avatar_url":"https://github.com/moclojer.png","language":"Clojure","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/moclojer/moclojer\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/moclojer/moclojer/raw/main/docs/assets/logo.png\"\u003e\n      \u003cimg src=\"https://github.com/moclojer/moclojer/raw/main/docs/assets/logo.png\" height=\"128\"\u003e\n    \u003c/picture\u003e\n    \u003ch1 align=\"center\"\u003emoclojer\u003c/h1\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca aria-label=\"CLAs Agree\" href=\"https://cla-assistant.io/moclojer/moclojer\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/CLAs-ff009e.svg?style=for-the-badge\u0026labelColor=000000\u0026label=agree\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"License\" href=\"https://github.com/moclojer/moclojer/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/badge/MIT-ff009e.svg?style=for-the-badge\u0026labelColor=000000\u0026label=LICENSE\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Join the community on GitHub\" href=\"https://github.com/moclojer/moclojer/discussions\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/badge/Join%20the%20community-ff009e.svg?style=for-the-badge\u0026labelColor=000000\u0026label=Discussion\"\u003e\n  \u003c/a\u003e\n\n  \u003cimg src=\"https://github.com/moclojer/moclojer/actions/workflows/linter.yml/badge.svg?branch=main\" alt=\"linter\"\u003e\n\n  \u003ca aria-label=\"CI Tests\" href=\"https://github.com/moclojer/moclojer/actions/workflows/tests.yml\"\u003e\n    \u003cimg src=\"https://github.com/moclojer/moclojer/actions/workflows/tests.yml/badge.svg?branch=main\" alt=\"tests\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.producthunt.com/posts/moclojer?utm_source=badge-featured\u0026utm_medium=badge\u0026utm_souce=badge-moclojer\" target=\"_blank\"\u003e\u003cimg src=\"https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=449961\u0026theme=neutral\" alt=\"moclojer - \u0026#0032;Simple\u0026#0032;and\u0026#0032;efficient\u0026#0032;HTTP\u0026#0032;mock\u0026#0032;server\u0026#0032;with\u0026#0032;easy\u0026#0032;spec | Product Hunt\" style=\"width: 250px; height: 54px;\" width=\"250\" height=\"54\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nSimple and efficient HTTP mock server with specification written in `yaml`, `edn` or `OpenAPI`.\n\n\u003e 💾 Download the `.jar` file with the latest version of moclojer to test on your computer [here](https://github.com/moclojer/moclojer/releases/latest).\n\n[**📖 See the complete documentation for moclojer here**](https://docs.moclojer.com/), if you want to contribute (or complement) the documentation, it is [here](https://github.com/moclojer/moclojer/tree/main/docs).\n\n**`YAML` example**\n\n```yaml\n# This mock register route: GET /hello/:username\n- endpoint:\n    # Note: the method could be omitted because GET is the default\n    method: GET\n    path: /hello/:username\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      # Note: the body will receive the value passed in the url using the\n      # :username placeholder\n      body: \u003e\n        {\n          \"hello\": \"{{path-params.username}}!\"\n        }\n```\n\n**WebSocket Support**\n\nMoclojer also supports WebSocket connections with a simple configuration approach:\n\n```yaml\n# WebSocket echo server\n- websocket:\n    path: /ws/echo\n    on-connect:\n      # Message sent when client connects\n      response: '{\"status\": \"connected\", \"message\": \"Welcome to WebSocket Echo!\"}'\n    on-message:\n      # Simple echo for \"ping\" message\n      - pattern: \"ping\"\n        response: \"pong\"\n      # Echo back any JSON content with an \"echo\" field\n      - pattern: '{\"echo\": \"{{json-params.echo}}\"}'\n        response: '{\"echoed\": \"{{json-params.echo}}\"}'\n```\n\nYou can test the WebSocket connection using tools like `websocat`:\n\n```sh\nwebsocat \"ws://localhost:8000/ws/echo\" --text\n```\n\n## docker\n\n* **image:** `ghcr.io/moclojer/moclojer:latest`\n* **port _(default)_:** `8000`_, if you want to change the port set the environment variable `PORT`_\n\n```sh\ndocker run -it \\\n  -p 8000:8000 -v $(pwd)/moclojer.yml:/app/moclojer.yml \\\n  ghcr.io/moclojer/moclojer:latest\n```\n\n**We have two versions available:**\n\n* `dev`: main branch docker image\n* `latest`: latest stable version image\n\n## manual installation\n\nWe distribute via the `.jar` file, you need to have Java installed on your operating system.\n\n```sh\nbash \u003c \u003c(curl -s https://raw.githubusercontent.com/moclojer/moclojer/main/install.sh)\n```\n\n\u003e If you are using Linux you maybe need `sudo`.\n\n## CLI Usage\n\n* `clj -M:run [OPTIONS]`\n* `java -jar moclojer.jar [OPTIONS]`\n* `moclojer_Linux [OPTIONS]`\n\n### Options\n\nparameter | description\n--- | ---\n`-c, --config` | Config path or the CONFIG environment variable. \\[**default:** `~/.config/moclojer.yml`\\]\n`-m, --mocks` | OpenAPI v3 mocks path or the MOCKS environment variable.\n`-f, --format` | Output and logging format. Either `println` or `json`.\n`-h, --help` | Show help information\n`-v, --version` | Show version information\n\n**sentry:** set environment var `SENTRY_DSN` ([sentry doc](https://docs.sentry.io/platforms/node/guides/azure-functions/configuration/options/#dsn)), automatic send backtrace to \u003csentry.io\u003e\n\n\u003e **Config** uses `XDG_CONFIG_HOME` to fetch the default moclojer configuration file, if you want to set a different directory you must use the `-c` or environment variable `CONFIG`\n\n## 💻 dev environment\n\nmoclojer is written in **Clojure**, to run the commands below we assume you have clojure _installed_ on your operating system.\n\n**run:**\n\n```sh\nclj -M:run\n```\n\n**test:**\n\n```sh\nclj -M:test\n```\n\n\u003e _if you want to run a specific test:_ `clj -M:test -n com.moclojer.external-body.excel-test`\n\n**`moclojer.jar` generate:**\n\n```sh\nclj -A:dev -M --report stderr -m com.moclojer.build\n```\n\n## framework integrations\n\nWe distribute the library via [Clojars](https://clojars.org/com.moclojer/moclojer).\n\n### Clojure CLI/deps.edn\n\n```clojure\ncom.moclojer/moclojer {:mvn/version \"0.3.1\"}\n```\n\n### Leiningen/Boot\n\n```clojure\n[com.moclojer/moclojer \"0.3.1\"]\n```\n\n### [`git`](https://clojure.org/guides/deps_and_cli#_using_git_libraries) in `deps.edn`\n\n```edn\n{:deps\n {com.moclojer/moclojer {:git/url \"https://github.com/moclojer/moclojer.git\"\n                         :git/tag \"v0.3.1\"\n                         :git/sha \"c4ca0f2cfcfbe47de6eb0c601b26106190e20793\"}}}\n```\n\n### example of use\n\n```clj\n(ns my-app.core\n  (:require [com.moclojer.adapters :as adapters]\n            [com.moclojer.server :as server]))\n\n(def *router\n  \"create a router from a config map\"\n  (adapters/generate-routes\n   [{:endpoint\n     {:method \"GET\"\n      :path \"/example\"\n      :response {:status 200\n                 :headers {:Content-Type \"application/json\"}\n                 :body {:id 123}}}}]))\n\n(defn -main\n  \"start the server\"\n  [\u0026 args]\n  (server/start-server! *router))\n```\n","funding_links":["https://opencollective.com/moclojer","https://github.com/sponsors/avelino"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoclojer%2Fmoclojer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoclojer%2Fmoclojer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoclojer%2Fmoclojer/lists"}