I'm getting frustrated with the static nature of the routes. I'd like to be able to reload my handler in the REPL and get it picked up by the live server. I'm even okay with restarting the server, but it's a bit galling to need to re-eval the handler, the API routes, the master routes, and then (reset)
on the server.
I'm contrasting Pedestal's use of the :io.pedestal.server/routes
key - it can be a function, which is run on each request. that's not very fast, but it's great for dev mode. it feels like using a Var for the handler in (yada/listener #'routes {:port 3000})
would work great, but looking at the code that just gets deref
'd right away, not on every call.
Just running (reset) should get it all up to date.. I’ve never had this issue..
I'm not using Edge, if that makes a difference. I think it handles this with the component system.
my (reset)
is simply stopping the old server and starting it again.
I'm also using reset to reload the routes
I got it working fairly nicely using clojure.tools.namespace.repl/refresh