Created
December 16, 2011 07:37
-
-
Save billdozr/1484983 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns myprj.data.core | |
(:require myprj.data.conf :as conf] | |
[myprj.data.routes :as routes]) | |
(:use [ring.adapter.jetty :only [run-jetty]])) | |
(let [port (Integer/parseInt (get (System/getenv) "PORT" "8080"))] | |
(defonce ^:dynamic *server* (run-jetty #'routes/core | |
{:port port :join? false | |
:host (:domain conf/site)}))) | |
(defn start [] (.start *server*)) | |
(defn stop [] (.stop *server*)) | |
(defn -main | |
"Entry point for the web application" | |
[] | |
(do (stop) (start))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment