remove public/index.js and make it so express can be stopped/started

This commit is contained in:
John Bintz 2016-01-13 06:51:46 -05:00
parent 46d42cc966
commit 5886d6cf9a
4 changed files with 32 additions and 72569 deletions

1
.gitignore vendored
View File

@ -12,5 +12,6 @@ pom.xml.asc
/.repl-*
/.cljs_node_repl/
/public/out
/public/index.js
/images

View File

@ -7,7 +7,8 @@
[lein-npm "0.6.1"]]
:source-paths ["src/server" "src/client"]
:npm { :dependencies [[ws "0.4.30"]
[imagemagick-native "https://github.com/elad/node-imagemagick-native.git"]]}
[imagemagick-native "https://github.com/elad/node-imagemagick-native.git"]
[express "4.13.3"]]}
:cljsbuild {
:builds [{:source-paths ["src/server"]
:compiler {
@ -45,4 +46,5 @@
[org.clojure/clojurescript "1.7.170"]
[org.omcljs/om "0.9.0"]
[sablono "0.3.6"]
[cljs-http "0.1.39"]
])

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
(ns picture-processor.server)
(def express (js/require "express"))
(def server (atom nil))
(defn- root-response
[req res]
(.send res "made it"))
(defn start
"Start the app server"
[port]
(let [app (express)]
(.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)
)))
(defn stop
"Stop the app server"
[]
(.close @server)
(reset! server nil))
(start 3000)
(stop)
(.log js/console @server)