clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
Timofey Sitnikov 2020-09-20T12:13:24.054200Z

Hello Clojurians, I am trying to learn how to get data from server when the home page is loaded. I am following the https://github.com/metosin/reitit/tree/master/examples/frontend, but it does not seem to indicate on how to request the data from the server, for example from GET /mydata route, which will return a json. Is there a function I should look up?

Felipe Marques 2020-09-20T12:47:26.054500Z

I believe you can use the Google Closure Library XHRIO https://developers.google.com/closure/library/docs/xhrio

Felipe Marques 2020-09-20T12:47:48.054800Z

Or some lib that wraps it, like https://github.com/r0man/cljs-http

1
Timofey Sitnikov 2020-09-20T12:58:08.055200Z

Hmm, so it is a whole external lib, not part of reitit, interesting.

Felipe Marques 2020-09-20T13:01:27.055400Z

I believe reitit is just for routing. For doing http you are going to need other solutions.

1