diff options
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | src/pronouns/web.clj | 8 |
2 files changed, 14 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fffd8d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +pom.xml +*jar +/classes/ +/.lein-deps-sum +/.lein-failures +/.lein-env +/checkouts +/.env +/target diff --git a/src/pronouns/web.clj b/src/pronouns/web.clj index 849465a..1a0ff63 100644 --- a/src/pronouns/web.clj +++ b/src/pronouns/web.clj @@ -10,7 +10,7 @@ [ring.adapter.jetty :as jetty] [environ.core :refer [env]])) -(def config {:server-port 5000}) +(def config {:default-server-port 5000}) (defroutes app-routes (GET "/" [] @@ -30,12 +30,14 @@ (def app (-> app-routes - ; logger/wrap-with-logger + logger/wrap-with-logger wrap-error-page trace/wrap-stacktrace)) (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: ;; (.stop server) |