{"id":13588670,"url":"https://github.com/testinggospels/camouflage","last_synced_at":"2026-01-03T02:14:31.058Z","repository":{"id":38346105,"uuid":"356872361","full_name":"testinggospels/camouflage","owner":"testinggospels","description":"Camouflage is a backend mocking tool for HTTP, gRPC, Websockets and Thrift protocols, which helps you carry out your front end prototyping, unit testing, functional/performance testing in silos, in absence of one or more Microservices/APIs.","archived":false,"fork":false,"pushed_at":"2024-02-20T11:10:33.000Z","size":11658,"stargazers_count":291,"open_issues_count":28,"forks_count":26,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-04-11T17:10:22.932Z","etag":null,"topics":["api-simulation","camouflage","camouflage-server","grpc","microservices-testing","mocks","mockserver","service-virtualization","stubbing","testing","thrift","thrift-server"],"latest_commit_sha":null,"homepage":"https://testinggospels.github.io/camouflage/","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/testinggospels.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-04-11T13:16:10.000Z","updated_at":"2025-04-02T00:32:56.000Z","dependencies_parsed_at":"2023-12-21T05:34:10.975Z","dependency_job_id":"1b50dcd7-4397-456e-af7b-1b806c4cc909","html_url":"https://github.com/testinggospels/camouflage","commit_stats":{"total_commits":212,"total_committers":12,"mean_commits":"17.666666666666668","dds":0.2028301886792453,"last_synced_commit":"c63c17676828867d0769483ba0da823a896ba264"},"previous_names":["fauxauldrich/camouflage"],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testinggospels%2Fcamouflage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testinggospels%2Fcamouflage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testinggospels%2Fcamouflage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testinggospels%2Fcamouflage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testinggospels","download_url":"https://codeload.github.com/testinggospels/camouflage/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248633478,"owners_count":21136874,"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-simulation","camouflage","camouflage-server","grpc","microservices-testing","mocks","mockserver","service-virtualization","stubbing","testing","thrift","thrift-server"],"created_at":"2024-08-01T15:06:51.365Z","updated_at":"2026-01-03T02:14:31.028Z","avatar_url":"https://github.com/testinggospels.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://testinggospels.github.io/camouflage/camouflage.png\" alt=\"camouflage.png\" width=\"300\"/\u003e\n    \u003ch3 align=\"center\"\u003eCamouflage\u003c/h3\u003e\n    \u003cp align=\"center\"\u003eHTTP/gRPC Mocking tool\u003c/p\u003e\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://nodei.co/npm/camouflage-server.png?downloads=true\"\u003e\u003cbr/\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/testinggospels/camouflage.svg\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/release/testinggospels/camouflage.svg\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/dm/camouflage-server\"\u003e\u003cbr/\u003e\n      \u003cimg src=\"https://github.com/testinggospels/camouflage/actions/workflows/release.yaml/badge.svg\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/repo-size/testinggospels/camouflage\"\u003e\n      \u003cimg src=\"https://img.shields.io/bundlephobia/min/camouflage-server\"\u003e\u003cbr/\u003e\u003cbr/\u003e\n      \u003ch3 align=\"center\"\u003e\u003ca href=\"https://testinggospels.github.io/camouflage/\"\u003eComplete Documentation\u003c/a\u003e\u003c/h3\u003e\n    \u003c/p\u003e\n\u003c/p\u003e\n\n# Support\n\n[![Chat on Discord](https://img.shields.io/badge/chat-Discord-7289DA?logo=discord)](https://discord.gg/hTqXuG7dsV)\n\n# What is Camouflage?\n\nCamouflage is a service virtualization tool inspired by [namshi/mockserver](https://github.com/namshi/mockserver). Camouflage works on a file based endpoint configuration system, which means it allows you to create a mock endpoint by simply creating a set of directories and a mock file, using which necessary responses are generated when you call the endpoint.\n\n# Available Features\n\n🔥 File based mocking support for HTTP, HTTPS, HTTP2, gRPC, Thrift and websockets. 🔥\n\n⚡ Dynamic/realistic responses without having to write any code. ⚡\n\n🧩 Flexibility to partially or fully code your responses. 🧩\n\n🎯 Conditional responses based on request parameters. 🎯\n\n🌟 Inbuilt Caching - In memory and redis. 🌟\n\n🧮 Ability to fetch and condition the response using external data. Currently supported data sources are CSV and postgres. 🧮\n\n⏳ Delay Simulation. ⏳\n\n🔍 Inbuilt monitoring. 🔍\n\n🦺 Inbuilt backup and restore mechanism. 🦺\n\n⏩ Quick start with `camouflage init` and `camouflage restore` modules. ⏩\n\n🎊 Deployable on standalone VMs, Dockers and Kubernetes. 🎊\n\n📁 Comes with a file explorer UI that allows modification of mock files hosted remotely. 📁\n\n✅ Validation of requests and responses using your OpenApi schema's. ✅\n\n# Getting Started\n\n1.  Camouflage is an NPM package, therefore to install Camouflage, you'd need to install NodeJS (\u003ev14) first, if you haven't already done so.\n2.  Install Camouflage: `npm install -g camouflage-server`\n3.  Run `camouflage --version` to validate the installation was successful.\n4.  Create an empty directory anywhere in your machine and navigate to it in your terminal.\n5.  For `npm` and `yarn`, execute command `camouflage init`, or use `npx degit camouflagejs/init myproject` irrespective of your pacakge manager, to initialize a Camouflage project.\n6.  This creates a basic skeleton of the folders you'd need in order to get started. You can modify these folders as per your requirements.\n7.  Start the Camouflage server by initializing it with a config.yml file: `camouflage --config config.yml`\n\n## Configuration Options / Sample Config yml File\n\n```yaml\nloglevel: info\ncpus: 1\nmonitoring:\n  port: 5555\nssl:\n  cert: \"./certs/server.cert\"\n  key: \"./certs/server.key\"\n  root_cert: \"./certs/root.cert\"\nprotocols:\n  http:\n    enable: true\n    mocks_dir: \"./mocks\"\n    port: 8080\n  https:\n    enable: false\n    port: 8443\n  http2:\n    enable: false\n    port: 8081\n  ws:\n    enable: false\n    mocks_dir: \"./ws_mocks\"\n    port: 8082\n  grpc:\n    enable: false\n    host: 0.0.0.0\n    port: 4312\n    mocks_dir: \"./grpc/mocks\"\n    protos_dir: \"./grpc/protos\"\n    grpc_tls: false\n  thrift:\n    enable: false\n    mocks_dir: \"./thrift/mocks\"\n    services:\n      - port: 9999\n        service: \"/opt/gen-nodejs/Calculator\"\n        handlers:\n          - add\n          - substract\n          - ping\nbackup:\n  enable: false\n  cron: \"0 * * * *\" # Hourly Backup\ncache:\n  enable: false\n  ttl_seconds: 300\ninjection:\n  enable: false\nvalidation:\n  enable: true\n  schemas:\n    - type: OpenApi\n      url: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json\norigins:\n  - http://localhost:3000\n  - http://localhost:3001\n  - http://localhost:5000\n# ext_helpers: \"./custom_handlebar.json\"\n```\n\n## Create your first mock\n\nCamouflage uses a file based system to configure the endpoints. For example, to create a mock to the endpoint /`hello-world`:\n\n1. You start by creating a directory `${MOCKS_DIR}/hello-world`\n2. Create a file GET.mock under `${MOCKS_DIR}/hello-world`\n3. Paste following content:\n\n```\nHTTP/1.1 200 OK\nX-Custom-Header: Custom-Value\nContent-Type: application/json\n\n{\n    \"greeting\": \"Hey! It works!\"\n}\n```\n\nNavigate to [http://localhost:8080/hello-world](http://localhost:8080/hello-world)\n\n`${MOCK_DIR}` is defined in `config.yaml` as `protocols.http.mocks_dir`. Refer to [docs](https://testinggospels.github.io/camouflage/) for more details.\n\n## Contributing\n\nAll and any relevant contributions to the project are welcome. Easiest way to contribute to Camouflage is to 🌟 the project. You can also help find typos and grammatical mistakes in the documentation to earn a quick 🟩 for your Github profile.\n\nIf you'd like to get into technical nitty gritty, I have tried my best to provide relevant comments throughout the code base with a [JSDocs](https://shubhendumadhukar.github.io/camouflage-jsdocs/) available too. Since we are still in beta, there are frequent changes in the codebase, which might at times lead to outdated JSDocs, in which case, feel free to reach out via [discussions](https://github.com/testinggospels/camouflage/discussions) or join us on [discord](https://discord.gg/hTqXuG7dsV).\n\nRaise an [issue](https://github.com/testinggospels/camouflage/issues/new?assignees=shubhendumadhukar\u0026labels=bug\u0026template=bug_report.md\u0026title=) if you think something is not working as expected, or if you'd like to request a [new feature](https://github.com/testinggospels/camouflage/issues/new?assignees=shubhendumadhukar\u0026labels=enhancement\u0026template=feature_request.md\u0026title=)\n\nRead the detailed [contributing guide](https://github.com/testinggospels/camouflage/blob/main/CONTRIBUTING.md)\n\n## Building from source\n\nCamouflage is quickly approaching it's first release i.e. v1.0.0, however while it is still in beta, there might be some bugs, missed use cases, incorrect implementations of some functionalities. This is to be expected. But, the good news is that we are constantly evolving.\n\nThere might be times when latest changes have not gone to release yet. You can find such changes in the `develop` branch of the repository, which is the most updated version of Camouflage. If you'd like to get your hands on the upcoming release of Camouflage at any point, you can build it from the source. However, since this source might contain changes that are not tested yet and are not ready for use, you might want to proceed with caution.\n\n1. Clone the repository: `git clone https://github.com/testinggospels/camouflage.git`\n2. Checkout `develop` branch: `git checkout develop`\n3. Install dependencies: `npm install`\n4. Build the project: `npm run build`\n5. At this point you can run Camouflage using: `node bin/camouflage.js --config ./config.yml`\n6. However if you'd like to install Camouflage globally, execute: `npm pack`\n7. Install by running command: `npm install -g camouflage-server-0.0.0-development.tgz` or `npm install -g camouflage-server-0.0.0-development.zip`\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2021 testinggospels\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","funding_links":[],"categories":["TypeScript","Tools"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestinggospels%2Fcamouflage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestinggospels%2Fcamouflage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestinggospels%2Fcamouflage/lists"}