Skip to content

Instantly share code, notes, and snippets.

@zoka
Created March 13, 2012 18:00
Show Gist options
  • Save zoka/2030301 to your computer and use it in GitHub Desktop.
Save zoka/2030301 to your computer and use it in GitHub Desktop.
(ns noirmon.server
(:require [noir.server :as server]
[noirmon.models :as models]
[ringmon.monitor :as monitor]))
(server/load-views "src/noirmon/views/")
(defn -main [& m]
(let [mode (keyword (or (first m) :dev))
port (Integer. (get (System/getenv) "PORT" "8080"))]
(models/initialize) ; initialize blog models
; This is the only thing to be done (besides including it
; in project depedency) to inject ringMon page into the
; application.
(server/add-middleware monitor/wrap-ring-monitor)
(server/start port {:mode mode
:ns 'noirmon})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment