Commit 03939d85 authored by Johannes Knödtel's avatar Johannes Knödtel 🎶
Browse files

use luminus-immutant

parent 8ba50c7a
......@@ -22,6 +22,7 @@
[prone "1.1.4"]
[migratus "0.8.32"]
[luminus-migrations "0.2.6"]
[luminus-immutant "0.2.2"]
[yesql "0.5.3"]
[to-jdbc-uri "0.3.0"]
[com.h2database/h2 "1.4.193"]
......
(ns gms.core
(:require [gms.handler :refer [app init destroy parse-port]]
[immutant.web :as immutant]
[luminus.http-server :as http]
[luminus-migrations.core :as migrations]
[taoensso.timbre :as timbre]
[environ.core :refer [env]])
......@@ -13,18 +13,17 @@
(defn start-server [port]
(init)
(reset! server (immutant/run app :host "0.0.0.0" :port port)))
(reset! server (http/start {:handler app :port port})))
(defn stop-server []
(when @server
(destroy)
(immutant/stop @server)
(http/stop @server)
(reset! server nil)))
(defn start-app [[port]]
(.addShutdownHook (Runtime/getRuntime) (Thread. stop-server))
(start-server (http-port port))
(timbre/info "server started on port:" (:port @server)))
(start-server (http-port port)))
(defn -main [& args]
(cond
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment