Fix license, bump deps

master
Jure Podgoršek 2018-08-07 16:44:39 +02:00
parent 79fc04f4d9
commit d421a03cc1
3 changed files with 12 additions and 12 deletions

View File

@ -2,7 +2,7 @@
:description "interactive visualization"
:url "https://kreten.si"
:license {:name "GNU Affero General Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:url "https://www.gnu.org/licenses/agpl-3.0.en.html"}
@ -12,8 +12,8 @@
[org.clojure/clojurescript "1.10.312"]
[org.clojure/core.async "0.4.474"]
[jarohen/chord "0.8.1"]
[ring "1.4.0"]
[compojure "1.5.0"]]
[ring "1.7.0-RC1"]
[compojure "1.6.1"]]
:plugins [[lein-figwheel "0.5.16"]
[lein-cljsbuild "1.1.7" :exclusions [[org.clojure/clojure]]]]

View File

@ -140,7 +140,5 @@
(.addEventListener js/window "resize" on-window-resize false)
(.addEventListener js/window "click" (fn []
(console.log "kleek")
(console.log @vtic)
(go-loop []
(>! @vtic "WAT"))))
(go []
(>! @vtic "ping"))))

View File

@ -5,8 +5,8 @@
[ring.middleware.reload :refer [wrap-reload]]
[chord.http-kit :refer [with-channel]]
[org.httpkit.server :refer [run-server]]
[clojure.core.async :refer [chan <! >! put! close! go go-loop]]
[clojure.core :refer [string]]))
[clojure.core.async :refer [chan <! <!! >! put! close! go go-loop]]
[clojure.string :as str]))
(defn socket-handler [request]
(let [cid (java.util.UUID/randomUUID)]
@ -17,11 +17,13 @@
(>! ws-ch (str "Hello " cid))
(go-loop []
(let [{:keys [message]} (<! ws-ch)]
(let [[cmd & args] (split message #":")]
(println "GOT MSG!" message)
(let [[cmd & args] (str/split message #":")]
(println "command" cmd "(" args ")")
(condp = cmd
"ping" (>! ws-ch "pong")
"echo" (>! ws-ch (str "pong" args))
(println "Dunno what to do with command " cmd)))
"Unknown command :/"))
(recur))))))))
;;(close! ws-ch)))))