Fork me on GitHub
#yada
<
2021-01-15
>
Braden Shepherdson12:01:48

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.

Lu12:01:08

Just running (reset) should get it all up to date.. I’ve never had this issue..

Braden Shepherdson12:01:19

I'm not using Edge, if that makes a difference. I think it handles this with the component system.

Braden Shepherdson12:01:37

my (reset) is simply stopping the old server and starting it again.

borkdude13:01:01

I'm also using reset to reload the routes

Braden Shepherdson13:01:33

I got it working fairly nicely using clojure.tools.namespace.repl/refresh