Browse files

Improved docstrings on compojure.handler functions

  • Loading branch information...
1 parent 73a2eed commit 1fac7c2e4f1c13878bf1168edb39644d62d369d6 @weavejester committed Feb 2, 2011
Showing with 17 additions and 4 deletions.
  1. +17 −4 src/compojure/handler.clj
View
21 src/compojure/handler.clj
@@ -7,22 +7,35 @@
cookies
session]))
-(defn- with-opts
- [routes middleware opts]
+(defn- with-opts [routes middleware opts]
(if opts
(middleware routes opts)
(middleware routes)))
(defn api
- "Create a handler suitable for a web API."
+ "Create a handler suitable for a web API. This adds the following
+ middleware to your routes:
+ - wrap-params
+ - wrap-nested-params
+ - wrap-keyword-params"
[routes]
(-> routes
wrap-keyword-params
wrap-nested-params
wrap-params))
(defn site
- "Create a handler suitable for a standard website."
+ "Create a handler suitable for a standard website. This adds the
+ following middleware to your routes:
+ - wrap-session
+ - wrap-cookies
+ - wrap-multipart-params
+ - wrap-params
+ - wrap-nested-params
+ - wrap-keyword-params
+
+ A map of options may also be provided. These keys are provided:
+ :session - a map of session middleware options"
[routes & [opts]]
(-> (api routes)
(wrap-multipart-params)

0 comments on commit 1fac7c2

Please sign in to comment.