Skip to content

Commit

Permalink
Added compojure.handler namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Dec 29, 2010
1 parent 845e7f9 commit 1396518
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/compojure/handler.clj
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,22 @@
(ns compojure.handler
(:use [ring.middleware params
keyword-params
nested-params
multipart-params
cookies
session]))

(defn api
"Create a handler suitable for a web API."
[routes]
(-> routes
wrap-keyword-params
wrap-nested-params
wrap-params))

(defn site
"Create a handler suitable for a standard website."
[routes]
(-> (api routes)
wrap-multipart-params
wrap-session))

0 comments on commit 1396518

Please sign in to comment.