Permalink
Browse files

Added compojure.handler namespace

  • Loading branch information...
1 parent 845e7f9 commit 1396518d3c720ad9aa01ecfac40ca0a5af4ac597 @weavejester committed Dec 29, 2010
Showing with 22 additions and 0 deletions.
  1. +22 −0 src/compojure/handler.clj
View
@@ -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.