Browse Source

aleph: Undo all my changes. I was fixing a non-problem.

Keith R. Gustafson 9 years ago
parent
commit
861f8938b9
1 changed files with 4 additions and 6 deletions
  1. 4 6
      frameworks/Clojure/aleph/hello/src/hello/handler.clj

+ 4 - 6
frameworks/Clojure/aleph/hello/src/hello/handler.clj

@@ -7,23 +7,21 @@
     [clj-tuple :as t])
   (:gen-class))
 
-(defn plaintext-response
-  []
+(def plaintext-response
   (t/hash-map
     :status 200
     :headers (t/hash-map "content-type" "text/plain; charset=utf-8")
     :body (bs/to-byte-array "Hello, World!")))
 
-(defn json-response
-  []
+(def json-response
   (t/hash-map
     :status 200
     :headers (t/hash-map "content-type" "application/json")))
 
 (defn handler [{:keys [uri] :as req}]
   (cond
-    (= "/plaintext" uri) (plaintext-response)
-    (= "/json" uri) (assoc (json-response)
+    (= "/plaintext" uri) plaintext-response
+    (= "/json" uri) (assoc json-response
                       :body (json/encode (t/hash-map :message "Hello, World!")))
     :else {:status 404}))