Skip to content

Instantly share code, notes, and snippets.

@dustingetz
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustingetz/15a5eda645df9694fea7 to your computer and use it in GitHub Desktop.
Save dustingetz/15a5eda645df9694fea7 to your computer and use it in GitHub Desktop.
Pedestal dynamic routes
(defn questions-get [req]
(api/collection-read ::questions-get
'[:find ?e :where [?e :Question/text]]
question/typeinfo))
(defn mk-handlers []
`{:get questions-get})
(def routes
(expand-routes
`[[["/api" {:get api/index}
^:interceptors [(body-params/body-params)
pedestal-util/auto-content-type
pedestal-util/combine-body-params]
["/questions" ~(mk-handlers)]
]]]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment