metosin / reitit

A fast data-driven routing library for Clojure/Script

Home Page:https://cljdoc.org/d/metosin/reitit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please warn on (-> my-routes (reitit.core/router) (ring/ring-handler))

theronic opened this issue · comments

Just lost 2 hours because I was passing (reitit.core/router my-routes) to (reitit.ring/ring-handler) instead of passing (reitit.ring/router my-routes). It's the second time this caught me over a two-year span.

Could Reitit warn the user if the Ring handler cannot handle the router passed to it? Or would it be possible for ring-handler to take a core router? It seems like the domain of translating from Ring -> Reitit matching should be handled by the ring-specific handler. (haven't looked into the underlying protocols)