Skip to content
Browse files

fix heroku integration

  • Loading branch information...
1 parent f723a69 commit 32ce68af6997dde0ab6ad32021159be2723c15a5 @raimohanska committed Aug 27, 2012
Showing with 10 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 Procfile
  3. +2 −1 project.clj
  4. +6 −1 src/baconjs/web.clj
View
1 .gitignore
@@ -1,3 +1,4 @@
lib
.lein-deps-sum
.lein-plugins
+*.war
View
2 Procfile
@@ -1 +1 @@
-web: lein trampoline run -m baconjs.web $PORT
+web: lein trampoline run -m baconjs.web
View
3 project.clj
@@ -2,6 +2,7 @@
:description "Bacon.js site"
:dependencies [[org.clojure/clojure "1.4.0"]
[compojure "1.1.1"]
- [hiccup "1.0.0"]]
+ [hiccup "1.0.0"]
+ [ring/ring-jetty-adapter "0.3.9"]]
:plugins [[lein-ring "0.7.1"]]
:ring {:handler baconjs.web/app})
View
7 src/baconjs/web.clj
@@ -1,6 +1,7 @@
(ns baconjs.web
(:use compojure.core
- [hiccup.middleware :only (wrap-base-url)])
+ [hiccup.middleware :only (wrap-base-url)]
+ ring.adapter.jetty)
(:require [compojure.route :as route]
[compojure.handler :as handler]
[compojure.response :as response]
@@ -16,3 +17,7 @@
(def app
(-> (handler/site main-routes)
(wrap-base-url)))
+
+(defn -main []
+ (let [port (Integer/parseInt (get (System/getenv) "PORT" "8080"))]
+ (run-jetty app {:port port})))

0 comments on commit 32ce68a

Please sign in to comment.
Something went wrong with that request. Please try again.