listen on the right pordt

This commit is contained in:
Morgan 2015-03-03 08:46:57 +00:00
parent 745314c13d
commit ca78ad1860
2 changed files with 14 additions and 3 deletions

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
pom.xml
*jar
/classes/
/.lein-deps-sum
/.lein-failures
/.lein-env
/checkouts
/.env
/target

View File

@ -10,7 +10,7 @@
[ring.adapter.jetty :as jetty] [ring.adapter.jetty :as jetty]
[environ.core :refer [env]])) [environ.core :refer [env]]))
(def config {:server-port 5000}) (def config {:default-server-port 5000})
(defroutes app-routes (defroutes app-routes
(GET "/" [] (GET "/" []
@ -30,12 +30,14 @@
(def app (def app
(-> app-routes (-> app-routes
; logger/wrap-with-logger logger/wrap-with-logger
wrap-error-page wrap-error-page
trace/wrap-stacktrace)) trace/wrap-stacktrace))
(defn -main [] (defn -main []
(jetty/run-jetty app {:port (:server-port config)})) (let [port (or (Integer. (env :port))
(:default-server-port config))])
(jetty/run-jetty app {:port port}))
;; For interactive development: ;; For interactive development:
;; (.stop server) ;; (.stop server)