This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-08
Channels
- # announcements (2)
- # beginners (75)
- # cider (2)
- # clj-kondo (8)
- # cljs-dev (4)
- # clojure (69)
- # clojure-europe (4)
- # clojure-nl (6)
- # clojure-uk (1)
- # clojurescript (17)
- # clojureverse-ops (1)
- # cursive (7)
- # lsp (7)
- # malli (10)
- # missionary (2)
- # off-topic (16)
- # pathom (4)
- # polylith (5)
- # portkey (1)
- # reitit (4)
- # rewrite-clj (1)
- # shadow-cljs (5)
- # spacemacs (3)
- # specter (3)
- # xtdb (14)
Hi,
I'm in the process of learning reitit, and I developed a simple program that has an endpoint and I'm trying to send a POST request to this endpoint using another simple application in clojurescript.
However after sending the request I got the following error on my browser console
`Access to XMLHttpRequest at 'http://localhost:3001/api/scramble' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.`
I already tried [ring-cors "0.1.13"]
with differents configurations of middleware. But didn't work.
Can help me solve that ?
Have a look here, https://github.com/dharrigan/startrek/blob/cbb200c8cf37224b803644536ba3bed8ab04e2ca/src/startrek/base/api/router.clj#L45, see if that is helpful? (a few lines down)
Hey @dharrigan, With this example this example you provided, I managed to make it work. Thanks a lot !