Fork me on GitHub
#reitit
<
2018-04-22
>
ikitommi07:04:42

Middleware ordering is a challenge. Chains usually require some implicit order and if not setup correctly, fail at runtime.

ikitommi07:04:32

For pedestal, there is angel-interceptor to reorder interceptors and Macchiato has similar for middleware (by @yogthos).

ikitommi07:04:02

Reitit already has the hook to transform the chain, and there could a spesification to declare mw/interceptor dependencies. Would enable automatic reordering. Is this a good idea? https://github.com/metosin/reitit/issues/33

ikitommi16:04:18

Should there be a helper for serving static files in reitit-ring? where is the line between “routing-lib” and “batteries-included”? poked with this, some code & perf in https://github.com/metosin/reitit/issues/71

ikitommi16:04:40

also, this would only work with Clojure. Everything else works with ClojureScript too. Hmm.

👍 4
dimovich21:04:17

currently using (-> (create-default-handler) (wrap-resource root) (wrap-defaults site-defaults))

ikitommi06:04:29

@U051951T6 wrap-resource first scans the classpath for resources, then fallbacks to “normal handler”. I think this is wrong: the resources should be served if nothing else matches. See some perf numbers at https://gist.github.com/ikitommi/f89a400e4670409c98358f425971ed63

dimovich08:04:53

ok... waiting for create-resource-handler from next reitit release...

dimovich08:04:59

thanks for the perf info