pedestal

coby 2019-11-05T16:27:09.056700Z

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?

2019-11-05T16:32:38.057300Z

@ctamayo perhaps Pedestal’s service-tools dev tooling is a better fit for you? https://github.com/pedestal/pedestal/blob/master/service-tools/src/io/pedestal/service_tools/dev.clj

coby 2019-11-05T16:35:11.057800Z

aha, yeah that looks promising! Thanks!

2019-11-05T16:37:42.058Z

np!

coby 2019-11-05T16:50:21.059800Z

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)))

coby 2019-11-05T16:52:24.060500Z

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

2019-11-05T17:49:03.062800Z

@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