Skip to content
Browse files

Using jetty server

  • Loading branch information...
1 parent a00c84e commit 75f0e2d55fedf4fa05ef21e1f9e1feff3dc76e8a @swaroopch committed Jul 27, 2013
Showing with 9 additions and 2 deletions.
  1. +1 −1 Procfile
  2. +2 −0 project.clj
  3. +6 −1 src/isbnnetinclj2/handler.clj
View
2 Procfile
@@ -1 +1 @@
-web: lein trampoline run -m isbnnetinclj2.server
+web: lein trampoline run -m isbnnetinclj2.handler
View
2 project.clj
@@ -5,6 +5,7 @@
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"] ; https://github.com/clojure/clojure
[compojure "1.1.5"] ; https://github.com/weavejester/compojure
+ [ring/ring-jetty-adapter "1.2.0"] ; https://github.com/ring-clojure/ring
[com.taoensso/timbre "2.4.1"] ; https://github.com/ptaoussanis/timbre
[com.taoensso/carmine "2.0.0"] ; https://github.com/ptaoussanis/carmine
[stencil "0.3.2"] ; https://github.com/davidsantiago/stencil
@@ -13,6 +14,7 @@
[clj-time "0.5.1"] ; https://github.com/clj-time/clj-time
]
:plugins [[lein-ring "0.8.5"]]
+ :main isbnnetinclj2.handler
:ring {:handler isbnnetinclj2.handler/app}
:profiles
{:dev {:dependencies [[ring-mock "0.1.5"]]}})
View
7 src/isbnnetinclj2/handler.clj
@@ -2,7 +2,8 @@
(:require [compojure.core :refer :all]
[compojure.handler :as handler]
[compojure.route :as route]
- [stencil.core :as mus]))
+ [stencil.core :as mus]
+ [ring.adapter.jetty :as jetty]))
(defn front-page-content
[]
@@ -20,3 +21,7 @@
(def app
(handler/site app-routes))
+
+(defn -main []
+ (jetty/run-jetty app-routes
+ {:port (or (System/getenv "PORT") 8080) :join? false}))

0 comments on commit 75f0e2d

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