{"id":22147702,"url":"https://github.com/testinggospels/camouflage_deno","last_synced_at":"2026-03-10T01:34:32.357Z","repository":{"id":52259448,"uuid":"363706858","full_name":"testinggospels/camouflage_deno","owner":"testinggospels","description":"HTTP/HTTPs Mocking tool","archived":false,"fork":false,"pushed_at":"2021-09-17T09:25:14.000Z","size":1691,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T04:26:31.799Z","etag":null,"topics":["camouflage","mocking","rest","service-virtualization","stub","testing"],"latest_commit_sha":null,"homepage":"https://testinggospels.github.io/camouflage_deno/","language":"HTML","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":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-02T17:12:32.000Z","updated_at":"2021-06-02T07:30:19.000Z","dependencies_parsed_at":"2022-09-10T04:34:21.134Z","dependency_job_id":null,"html_url":"https://github.com/testinggospels/camouflage_deno","commit_stats":null,"previous_names":["fauxauldrich/camouflage_deno"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/testinggospels/camouflage_deno","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testinggospels%2Fcamouflage_deno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testinggospels%2Fcamouflage_deno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testinggospels%2Fcamouflage_deno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testinggospels%2Fcamouflage_deno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testinggospels","download_url":"https://codeload.github.com/testinggospels/camouflage_deno/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testinggospels%2Fcamouflage_deno/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30320889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"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":["camouflage","mocking","rest","service-virtualization","stub","testing"],"created_at":"2024-12-01T23:20:09.274Z","updated_at":"2026-03-10T01:34:32.333Z","avatar_url":"https://github.com/testinggospels.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getting Started\n\n\u003cimg src=\"docs/camouflage.png\" alt=\"camouflage.png\" width=\"300\"/\u003e\n\n[Full Documentation](https://fauxauldrich.github.io/camouflage_deno/)\n\nCamouflage is a service virtualization tool inspired by [namshi/mockserver](https://github.com/namshi/mockserver). As the original description says, the mocking/service virtualization works on a file based structure where _you simply organize your mocked HTTP responses in a bunch of mock files and it will serve them like they were coming from a real API; in this way you can write your frontends without caring too much whether your backend is really ready or not._\n\n- Camouflage is a deno module, therefore to install Camouflage, you'd need to [install Deno](https://deno.land/#installation) first, if you haven't already done so.\n- You can then import Camouflage into your project:\n\n```javascript\nimport { CamouflageConfig, CamouflageServer } from \"https://deno.land/x/camouflage@0.0.2/mod.ts\";\n```\n\n- Note that you'd also need to provide a config file to initialize Camouflage.\n\n```javascript\nimport { YamlLoader } from \"https://deno.land/x/yaml_loader/mod.ts\";\nconst configLoader = new YamlLoader();\nconst config: CamouflageConfig = \u003cCamouflageConfig\u003eawait configLoader.parseFile(\"./config.yaml\");\n```\n\n- Create a `config.yaml` file at the root of your project. And paste the following content (update if required).\n\n```yaml\nloglevel: INFO\nprotocols:\n  http:\n    enable: true\n    port: 8080\n    mocks: \"./mocks\"\n  https:\n    enable: true\n    port: 8443\n    cert: \"./certs/server.crt\"\n    key: \"./certs/server.key\"\n```\n\n- In case you need HTTPs endpoints, create .crt and .key files before starting the server. For testing purposes you can generate a self-signed certificate. If HTTPs endpoints are not required, update above config.yaml to disable https protocol\n\n```shell\nopenssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout server.key -out server.crt\n```\n\n- For simplicity, create an `inputs` array to store the configs in following order.\n\n```javascript\nconst inputs = [\n  config.loglevel,\n  config.protocols.http.enable,\n  config.protocols.http.port,\n  config.protocols.http.mocks,\n  config.protocols.https.enable,\n  config.protocols.https.port,\n  config.protocols.https.cert,\n  config.protocols.https.key,\n];\n```\n\n- Finally, create an instance of `CamouflageServer` and call `start()` by spreading the `inputs` array as it's parameters\n\n```javascript\nconst camouflageServer: CamouflageServer = new CamouflageServer();\n// @ts-ignore ignore\ncamouflageServer.start(...inputs);\n```\n\n- Run using the command\n\n```shell\ndeno run --allow-net --allow-read --allow-write --unstable test.ts\n```\n\n## Create your first mock\n\nCamouflage follows the same convention as mockserver to create mocks. For example,\n\n```\nAll further references to the variable ${MOCK_DIR} in this documentation will refer\nto the directory you have specified in your config.yaml file under\nconfig.protocols.http.mocks\n```\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestinggospels%2Fcamouflage_deno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestinggospels%2Fcamouflage_deno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestinggospels%2Fcamouflage_deno/lists"}