Closed winpat closed 1 year ago
You're not calling handler
with id
. So what you want is:
(defroutes app
(GET "/:id" [id] (handler id)))
Instead, you're returning the hander
function from the route. When this happens, Compojure treats it as a Ring handler. In other words:
(GET "/example" _ handler)
Is identical to:
(GET "/example" request (handler request))
Thank you for your explanation! This makes total sense now.
First things first, thank you for your awesome libraries!
I am trying to get the first code sample of the following wiki page working:
Given the following code sample:
When making the following request:
I would expect the handler to receive "12" as the only argument. Instead I get the entire request map.
Deps used are:
Is this intended? Am I doing something wrong?