Fork me on GitHub
#pedestal
<
2017-09-29
>
viniciushana20:09:45

Hey, quick one but I feel like I'm missing something terribly obvious: I'm defining routes using table syntax, but I'm a pickle trying to make Pedestal find out route names by the handlers. A simple sample is:

(defn current-version
  [{{config :config} :components}]
  {:status 200 :body {:version (config/version config)}})

...
 
["/api/version" :get (conj public-interceptors current-version)]
Above code breaks that the last interceptor had no name and there is no explicit :route-name. What could be done differently on the handler function to allow Pedestal to infer the route name? I was under the impression that it used the symbol's name but that doesn't seem to be the case.

viniciushana21:09:38

Got it: I gotta provide the handler fn as a symbol (with a backquote), then it works.

viniciushana21:09:10

["/api/version" :get (conj public-interceptors `current-version)]