Hello. Just getting acquainted with reitit, and am wondering what is the state of CORS support in Reitit... Found on the web problems with ring CORS middleware, so are there some news on this, and if there's still no official Reitit support for this, how do people handling it in the mean time?
I roll my own, i.e.,
(ring/router
[["/api"
["/ping" {:get {:handler pong}}]
["/foo"
["" {:options {:handler cors-handler}
...
...
(def cors {"Access-Control-Allow-Origin" "*"
"Access-Control-Allow-Headers" "Origin, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Content-Type, *"})
(defn cors-handler
[_]
{:headers cors :status ok})
works for me 🙂
others may have different approaches 🙂
ok ,thanx
np. It's super simple to do it yourself 🙂
ttfn! 🙂