From 21233c66bbab539e1ff6a5ecc2fd6cc02221b622 Mon Sep 17 00:00:00 2001 From: jay vyas Date: Fri, 11 May 2012 23:02:11 -0300 Subject: [PATCH 1/4] Added "export port=8000" explanation, and also, the find/replace command to replace the packagename with a custom packagename. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index f631dc5..0e6e76c 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Get Started * lein repl * (use 'samplewebapp.main-local) * (boot) +* export PORT=8080 (the app reads this in from the environment). * Open http://localhost:8080 in your web browser: you should see a welcome message. For other URLs to try take a look into routes.clj. Run on Heroku @@ -18,6 +19,12 @@ To run the webapp with Heroku we need the Procfile file and main-heroku.clj. Here is a description of how to run Clojure apps on Heroku: http://blog.heroku.com/archives/2011/7/5/clojure_on_heroku/ +Customize it ! +-------------- +(Optional - replace the "samplewebapp" strings with your web app's name). +find . -type f -print0 | xargs -0 sed -i 's/samplewebapp/myAppName/g' + + License ------- This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. From 9401ce9409c04141e5fb30ab2147e59f4188e380 Mon Sep 17 00:00:00 2001 From: jay vyas Date: Fri, 11 May 2012 23:06:13 -0300 Subject: [PATCH 2/4] added port args and removed unnecessary additional find/replace hack --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0e6e76c..79074e7 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,13 @@ Get Started * lein repl * (use 'samplewebapp.main-local) * (boot) -* export PORT=8080 (the app reads this in from the environment). * Open http://localhost:8080 in your web browser: you should see a welcome message. For other URLs to try take a look into routes.clj. +Running it locally with lein +---------------------------- +export PORT=8000 +lein run -m samplewebapp.main-heroku + Run on Heroku ------------- First create a new app at Heroku with the cedar stack: heroku create --stack cedar @@ -19,11 +23,11 @@ To run the webapp with Heroku we need the Procfile file and main-heroku.clj. Here is a description of how to run Clojure apps on Heroku: http://blog.heroku.com/archives/2011/7/5/clojure_on_heroku/ -Customize it ! --------------- -(Optional - replace the "samplewebapp" strings with your web app's name). -find . -type f -print0 | xargs -0 sed -i 's/samplewebapp/myAppName/g' +Run locally +----------- +You can run it in lein locally : +lein run -m samplewebapp.main-heroku License ------- From f5b74585d973278f4629eab8b07604058b7eba10 Mon Sep 17 00:00:00 2001 From: jay vyas Date: Fri, 11 May 2012 23:06:35 -0300 Subject: [PATCH 3/4] bullets --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 79074e7..9e60de0 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ Get Started Running it locally with lein ---------------------------- -export PORT=8000 -lein run -m samplewebapp.main-heroku +* export PORT=8000 +* lein run -m samplewebapp.main-heroku Run on Heroku ------------- From 417b8dd71e51a038995cc5c9e97d9d66ba0c0560 Mon Sep 17 00:00:00 2001 From: jay vyas Date: Fri, 11 May 2012 23:11:00 -0300 Subject: [PATCH 4/4] necessary import for the wrap-file function. --- src/samplewebapp/main_heroku.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/samplewebapp/main_heroku.clj b/src/samplewebapp/main_heroku.clj index 1b7589e..24c7a68 100644 --- a/src/samplewebapp/main_heroku.clj +++ b/src/samplewebapp/main_heroku.clj @@ -1,6 +1,7 @@ (ns samplewebapp.main-heroku (:use ring.adapter.jetty) (:use samplewebapp.routes) + (:use ring.middleware.file) (:require [compojure.handler :as handler])) ; Ring provides that adapter to Jetty and the underlying HTTP requests and responses. ; Difference to main-local.clj is that automatic reloading and browser stacktrace is not available under Heroku.