(defroutes my-routes
(GET "/:id" [id] (html/display-thing id)))
(def my-map
{:id 1 :title "One"
:id 2 :title "Two"})
Is there a nice way to check if the url parameter id
exists in my-map
else continue checking if the other routes match? I know you can do something similar with regex like so: ["/:id", :id #"[0-9]+"]
and suspect it might be possible to plug in an arbitrary predicate function.