Permalink
Browse files

use cljs-http to make a remote call back to server

  • Loading branch information...
jflinchbaugh committed Mar 9, 2018
1 parent 6b5e684 commit 8258fc442f540a6f31b8cce680b88266f7950208
Showing with 11 additions and 2 deletions.
  1. +2 −0 project.clj
  2. +9 −2 src-cljs/cheshire_cat/core.cljs
View
@@ -8,6 +8,8 @@
[ring/ring-defaults "0.2.1"]
[ring/ring-json "0.4.0"]
[org.clojure/clojurescript "1.9.946"]
[cljs-http "0.1.44"]
[org.clojure/core.async "0.4.474"]
]
:plugins [
[lein-ring "0.9.7"]
@@ -1,8 +1,15 @@
(ns cheshire-cat.core
(:require [clojure.browser.repl :as repl])
(:require-macros [cljs.core.async.macros :refer [go]])
(:require
[clojure.browser.repl :as repl]
[cljs-http.client :as http]
[cljs.core.async :refer [<!]])
)
(defn ^:export init []
; (js/alert "hi")
(repl/connect "http://localhost:9000/repl")
(go
(let [response (<! (http/get "/cheshire-cat"))]
(js/alert (:body response))
))
)

0 comments on commit 8258fc4

Please sign in to comment.