Fork me on GitHub
#pedestal
<
2018-07-08
>
alice06:07:39

I'm really confused by pedestal right now. I'm trying to generate a url for a route, I've defined url for with (route/url-for-routes routes), and when I expand the routes I can see the name for the route I want, :route-name :user, but when I go to (url-for :user) it says ExceptionInfo Route not found clojure.core/ex-info (core.clj:4739)

alice06:07:57

If I curl the route it exists and works, but I can't generate urls and I'm totally stumped

martinklepsch07:07:38

@alice url-for uses a dynamic vat that is only bound when handling requests I believe. Are you trying to generate a URL in a REPL by any chance?

alice07:07:46

Yes I am. but I'm also defining my own url-for

(def url-for (route/url-for-routes routes))
And using that as the function as described here http://pedestal.github.io/pedestal/io.pedestal.http.route.html#var-url-for-routes

martinklepsch16:07:58

And that is not working?