Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from technomancy/master

Couple changes for more idiomatic code.
  • Loading branch information...
commit 5c3f449035c958b105344fb06256d05661e97fff 2 parents 6194e5d + cf33934
@metadaddy-sfdc authored
Showing with 12 additions and 13 deletions.
  1. +1 −0  .gitignore
  2. +4 −6 project.clj
  3. +7 −7 src/sample/app.clj
View
1  .gitignore
@@ -5,3 +5,4 @@ lib
.DS_Store
vars.sh
localvars.sh
+/.lein-deps-sum
View
10 project.clj
@@ -1,9 +1,7 @@
(defproject clojure-force-sample "1.0.0"
:description "Hello World Clojure Web App"
- :dependencies [[org.clojure/clojure "1.2.0"]
- [org.clojure/clojure-contrib "1.2.0"]
- [compojure "0.4.1"]
- [ring/ring-jetty-adapter "0.2.5"]]
- :dev-dependencies [[lein-run "1.0.0"]
- [ring/ring-devel "0.2.5"]]
+ :dependencies [[org.clojure/clojure "1.3.0"]
+ [compojure "1.0.0-RC1"]
+ [ring/ring-jetty-adapter "1.0.0"]]
+ :dev-dependencies [[ring/ring-devel "0.2.5"]]
:main sample.app)
View
14 src/sample/app.clj
@@ -1,13 +1,13 @@
(ns sample.app
- (:use (ring.adapter jetty)
- (compojure core)))
+ (:use [compojure.core :only [defroutes GET]])
+ (:require [ring.adapter.jetty :as jetty]))
(defroutes handler
(GET "/" []
- {:headers {"Content-type" "text/html; charset=UTF-8"}
- :body "Hello world!"}))
+ {:headers {"Content-type" "text/html; charset=UTF-8"}
+ :body "Hello world!"}))
(defn -main []
- (run-jetty
- handler
- {:port (Integer/parseInt (get (System/getenv) "PORT" "8080"))}))
+ (jetty/run-jetty handler
+ {:port (Integer/parseInt
+ (or (System/getenv "PORT") "8080"))}))
Please sign in to comment.
Something went wrong with that request. Please try again.