Skip to content

Instantly share code, notes, and snippets.

Last active Feb 19, 2020
What would you like to do?
(defn my-regular-handler
{:status 200 :headers {} :body []})
(defn my-resource-handler
[datasource req]
(let [foo (do-something-with-datasource datasource req)]
{:status 200 :headers {} :body foo}))
(defn make-top-level-handler
[["/" {:get {:handler my-regular-handler}}]
["/get-thing" {:get {:handler (partial my-resource-handler datasource)}}]])
(reitit.ring/create-resource-handler {:path "/"})
{:middleware [,,,]}))
(defmethod ig/init-key ::app
[_ {:keys [datasource]}]
(make-top-level-handler datasource))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment