Fork me on GitHub
#pedestal
<
2019-11-05
>
coby16:11:09

I'm trying to load Ring's wrap-reload middleware as an interceptor. I think since wrap-reload returns a handler function that an interceptor created from wrap-reload would also necessarily be a handler, and would therefore have to go at the end of the interceptor queue. Is that right?

coby16:11:11

aha, yeah that looks promising! Thanks!

coby16:11:21

I'm a little confused about how/where to use this, though...do I wrap the expanded routes var in run-dev? So something like...

;; Routes can be a function that resolve routes,
              ;;  we can use this to set the routes to be reloadable
              ::server/routes #(route/expand-routes (dev-tools/watch-routes-fn (deref #'service/routes)))

coby16:11:24

or ::server/routes #(dev-tools/watch-routes-fn (route/expand-routes (deref #'service/routes)))?? both of these throw runtime exceptions

ddeaguiar17:11:03

@ctamayo, watch should be sufficient. The fact that the run-dev service map uses (deref #'service/routes) leads to the routes being evaluated on every request