cleanup server.cljs a tad

Left some in-editor execution stuff in there
This commit is contained in:
John Bintz 2016-01-13 06:54:05 -05:00
parent 5886d6cf9a
commit b72952b415
1 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,9 @@
(ns picture-processor.server)
; js requires
(def express (js/require "express"))
; the currently running server
(def server (atom nil))
(defn- root-response
@ -11,18 +14,16 @@
"Start the app server"
[port]
(let [app (express)]
; build the routing tree
(.get app "/" root-response)
(let [-server (.listen app port #(.log js/console (str "Server listening on port " port)))]
(reset! server -server)
(.log js/console @server)
)))
(let [-server (.listen app
port
#(.log js/console (str "Server listening on port "
port)))]
(reset! server -server))))
(defn stop
"Stop the app server"
[]
(.close @server)
(reset! server nil))
(start 3000)
(stop)
(.log js/console @server)