@@ -2,7 +2,8 @@
:dependencies [[org.clojure/clojure :clj1.8]
[ring "1.4.0"]
[com.analogzen.clojure-stack/web-client "0.0.1-SNAPSHOT"]
- [http-kit "2.1.18"]]
+ [http-kit "2.1.18"]
+ [environ "1.0.2"]]
:plugins [[lein-modules "0.3.11"]]
:main example.main
@@ -9,6 +9,6 @@
(def app (-> say-hi
(wrap-resource "public")))
-(defn start! []
- (println "server on.")
- (run-server app {:port 8080}))
+(defn start! [port]
+ (println "server on. port: " port)
+ (run-server app {:port port}))
@@ -1,8 +1,17 @@
(ns example.main
- (:require [example.core :as core])
+ (:require [example.core :as core]
+ [environ.core :refer [env]]
+ ;[clojure.tools.cli :refer [parse-opts]]
+ )
(:gen-class))
; this file exists as a shim between boot loading and reloadable core code. if the need to AOT goes away, this can too.
+(def cli-options [["-p" "--port Port" "Port Number"
+ :default 3000
+ :parse-fn #(Integer/parseInt %)]])
+
(defn -main []
- (core/start!))
+ (let [port (Integer/parseInt (env :port))]
+ (core/start! port)))