reitit

Jeremy 2024-12-11T18:19:48.349119Z

Hi all, reitit.http/router throws error with var handlers. is there a workaround? also, whats the difference between http/router and ring/router? they both seem to work the same way (I thought ring doesn't support interceptors)

Jeremy 2024-12-11T18:35:03.645559Z

there's also reitit.core/router . is it the same as http/router?

Jeremy 2024-12-13T18:09:44.003119Z

copying the default implementation of IFn's IntoInterceptor protocol worked for me:

(extend-protocol reitit.interceptor/IntoInterceptor
    clojure.lang.Var
    (into-interceptor [this data opts]
      (reitit.interceptor/into-interceptor
       {:name ::handler
        ::handler @this
        :enter (fn [ctx]
                 (assoc ctx :response (@this (:request ctx))))}
       data opts)))