{"id":20058621,"url":"https://github.com/tlewin/pedestal-controller","last_synced_at":"2026-06-08T03:31:46.038Z","repository":{"id":62434219,"uuid":"192983031","full_name":"tlewin/pedestal-controller","owner":"tlewin","description":"Simple controller mechanism for Pedestal applications","archived":false,"fork":false,"pushed_at":"2019-07-01T19:47:21.000Z","size":29,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-16T20:53:45.511Z","etag":null,"topics":["clojure","controller","pedestal"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tlewin.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":"2019-06-20T20:24:22.000Z","updated_at":"2022-12-08T23:52:29.000Z","dependencies_parsed_at":"2022-11-01T20:46:11.186Z","dependency_job_id":null,"html_url":"https://github.com/tlewin/pedestal-controller","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tlewin/pedestal-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fpedestal-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fpedestal-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fpedestal-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fpedestal-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tlewin","download_url":"https://codeload.github.com/tlewin/pedestal-controller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fpedestal-controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34047266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["clojure","controller","pedestal"],"created_at":"2024-11-13T13:02:28.477Z","updated_at":"2026-06-08T03:31:46.012Z","avatar_url":"https://github.com/tlewin.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pedestal-controller [![Build Status](https://travis-ci.org/tlewin/pedestal-controller.svg?branch=master)](https://travis-ci.org/tlewin/pedestal-controller) [![Clojars Project](https://img.shields.io/clojars/v/pedestal-controller.svg)](https://clojars.org/pedestal-controller)\n\nSimple controller mechanism for [Pedestal](http://pedestal.io/) applications.\n\n## Usage\n\nThe main idea behind controllers is to define a set of\nhandlers that shares the same interceptors/ settings,\nmaking the entire process less error-prone and easy to maintain.\n\n```clojure\n(defcontroller Product\n  (interceptors [common-interceptors\n                 [auth :only [:create]]\n                 [json-body :except [:search]]])\n\n  (handler create\n           (fn [request]\n             (let [{{data :data} :params} request]\n               (ring-resp/response (build-product! data)))))\n\n  (handler search\n           (fn [request]\n             (let [{{query :query} :params} request]\n               (ring-resp/response (render (search query)))))))\n\n(interceptors Product)    ;; [default auth]\n(handlers Product)        ;; {:create (fn ...) :search (fn ...)}\n(handler Product :create) ;; (fn ... )\n```\n\nWith the controllers, it's possible to add routes without defining\ninterceptors configuration:\n\n```clojure\n(def routes\n  (remap-routes\n   #{[\"/products\"        :post Product :create]\n     [\"/products/search\" :get  Product :search]\n     ;; Although it's not mandatory and the old \"syntax\" still valid.\n     [\"/about\"           :get (conj common-interceptors `about-page)]}))\n```\n\n## License\n\nCopyright © 2019 Thiago Lewin\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlewin%2Fpedestal-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlewin%2Fpedestal-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlewin%2Fpedestal-controller/lists"}