reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
FiVo 2020-05-15T14:12:58.413200Z

Hey, I have asked before but haven't found a solution. Is it possible to use reitit with hash-fragments in the frontend? So that [:a {:href "/sub-page2#foo}] navigates to the correct subsection.

ikitommi 2020-05-15T14:43:08.413600Z

@rextruong tested and that works ok:

(defn wrap-test [handler]
  (fn [req] (handler req)))

((ring/ring-handler
   (ring/router
     ["/ping" {:get (constantly {:status 200, :body "pong"})}])
   nil
   {:middleware [#(wrap-test %)]})
 {:request-method :get
  :uri "/ping"})
; => {:status 200, :body "pong"}

ikitommi 2020-05-15T14:44:20.414900Z

ring uses 2 arities, sync (1) and async (3), if your ring-adapter is configured for async, all middleware are also required to have 3 arity. If that’s not the reason, I would just restart the repl. Could be some dirty state in mount.