cleanup server.cljs a tad
Left some in-editor execution stuff in there
This commit is contained in:
parent
5886d6cf9a
commit
b72952b415
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user