Skip to content

Commit

Permalink
Using ring response to make the code shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
adomokos committed Oct 15, 2015
1 parent 8cc9b9a commit c9e9bb4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/kashmir/handler.clj
Expand Up @@ -2,14 +2,13 @@
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.util.response :as rr]
[kashmir.logic :as logic]))

(defroutes api-routes
(GET "/" [] "Hello World")
(GET "/members/:id{[0-9]+}" [id]
{:status 200
:headers {"Content-Type" "application/json; charset=utf-8"}
:body (logic/find-member (read-string id))})
(rr/response (logic/find-member (read-string id))))
(route/not-found "Not Found"))

(def app
Expand Down

0 comments on commit c9e9bb4

Please sign in to comment.