{"id":32183963,"url":"https://github.com/instantwebsite/cawdy","last_synced_at":"2026-03-07T23:01:18.171Z","repository":{"id":62431364,"uuid":"303779882","full_name":"instantwebsite/cawdy","owner":"instantwebsite","description":"Clojure library for interacting with the Caddy Admin API over HTTP","archived":false,"fork":false,"pushed_at":"2020-12-17T11:43:03.000Z","size":36,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T07:38:47.256Z","etag":null,"topics":["caddy","caddy-server","caddy2","caddyserver","clojure","library"],"latest_commit_sha":null,"homepage":"","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/instantwebsite.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-10-13T17:25:47.000Z","updated_at":"2024-04-12T10:06:33.000Z","dependencies_parsed_at":"2022-11-01T20:46:37.925Z","dependency_job_id":null,"html_url":"https://github.com/instantwebsite/cawdy","commit_stats":null,"previous_names":["victorb/cawdy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/instantwebsite/cawdy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantwebsite%2Fcawdy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantwebsite%2Fcawdy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantwebsite%2Fcawdy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantwebsite%2Fcawdy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instantwebsite","download_url":"https://codeload.github.com/instantwebsite/cawdy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantwebsite%2Fcawdy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30236042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: 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":["caddy","caddy-server","caddy2","caddyserver","clojure","library"],"created_at":"2025-10-21T23:29:08.740Z","updated_at":"2026-03-07T23:01:18.162Z","avatar_url":"https://github.com/instantwebsite.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cawdy\n\n[![Clojars Project](https://img.shields.io/clojars/v/cawdy.svg)](https://clojars.org/cawdy)\n[![CircleCI](https://circleci.com/gh/victorb/cawdy/tree/master.svg?style=svg)](https://circleci.com/gh/victorb/cawdy/tree/master)\n\nClojure library for interacting with Caddy via the HTTP Admin API\n\nTested with Caddy v2.2.1\n\n## Installation\n\n### Leiningen\n\n```\n[cawdy \"0.3.1\"]\n```\n\n### deps.edn\n\n```\ncawdy {:mvn/version \"0.3.1\"}\n```\n\n## Usage\n\n### Quickstart\n\nCreates a new server that listens on :2015 and serves two domains. One that\ngives a static response (`:static`) for all requests and one that serves files\nfrom a directory (`:files`)\n\n```clojure\n(require '[cawdy.core :as cawdy])\n(def conn (cawdy/connect \"http://localhost:2019\")\n(cawdy/create-server conn {:listen [\":2015\"]})\n(cawdy/add-route conn :my-id \"cawdy-response.example\" :static {:body \"hello\"}))\n(cawdy/add-route conn :my-id \"cawdy-files.example\" :files {:root \"/etc\"}))\n```\n\n### Connect to running Caddy server\n\n```clojure\n(require '[cawdy.core :as cawdy])\n(def conn (cawdy/connect \"http://localhost:2019\")\n```\n\n### Get Current Configuration\n\n```clojure\n(cawdy/config conn)\n=\u003e {:apps\n    {:http\n     {:servers\n      {:my-id\n       {:listen [\"localhost:2016\"],\n        :routes\n        [{:handle\n          [{:handler \"file_server\", :root \"/tmp/cawdytest2\"}]}]}}}}})\n```\n\n### Add Static Response Handler\n\n```clojure\n(cawdy/create-server conn {:listen [\":2019\"]})\n(cawdy/add-route conn :my-id \"localhost\" :static {:body \"This gets returned\"}))\n```\n\n```shellsession\n$ curl --silent localhost:2019\nThis gets returned\n```\n\nOptions for :static handler can be:\n\n- `:body` - What to send in the response body\n\n### Add File Server Handler\n\n```clojure\n(cawdy/create-server conn {:listen [\":2020\"]})\n(cawdy/add-route conn :my-id \"localhost\" :static {:root \"/etc\"}))\n```\n\n```shellsession\n$ curl --silent localhost:2020/hosts\n# Static table lookup for hostnames.\n...\n```\nOptions for :files handler are:\n\n- `:root` - What directory should act as the root directory\n\n## Tests\n\nRun tests with `make test` that will automatically download a compatible\nCaddy version to run the tests with. It'll also start caddy with no config,\nand turn it off after the tests.\n\nDon't run the tests with a caddy instance whos config is important as the\ntests will remove the existing config before each test.\n\n## License\n\nCopyright © 2020 Victor Bjelkholm under MIT license, see `LICENSE`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstantwebsite%2Fcawdy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstantwebsite%2Fcawdy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstantwebsite%2Fcawdy/lists"}