Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (25 sloc) 0.69 kb
(ns compojure.handler
(:use [ring.middleware params
keyword-params
nested-params
multipart-params
cookies
session]))
(defn- with-opts
[routes middleware opts]
(if opts
(middleware routes opts)
(middleware routes)))
(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 & [opts]]
(-> (api routes)
(wrap-multipart-params)
(with-opts wrap-session (:session opts))))
Jump to Line
Something went wrong with that request. Please try again.