- app-handler
(app handler-body)
- handler-body
- middleware* handler-main
- middleware
a-symbol ; must evaluate to a function taking a handler and returning a handler
(some clojure code) ; (some XXX clojure code) must evaluate to a handler — where XXX is the handler to wrap
- handler-main
- (route shorthand-or-handler)+ ; route-based dispatch
- method-dispatch
{a-literal ring-response-map}
"a-string" clojure-expr* ; send a response whose body is (str "a-string" ...)
a-symbol ; must evaluate to a handler
(some clojure code) ; must evaluate to a handler
- route
[segment* (& tail-binding?)?]
- segment
"a-string"
#"a-pattern"
a-symbol ; when the route matches, is locally bound to the matching segment
[a-symbol-or-destructuring-form validator]
- validator
"a-string" ; shorthand for #{"a-string"}
#"a-pattern" ; shorthand for #(re-matches #"a-pattern" %)
a-symbol ; must evaluate to a function
(some clojure code) ; must evaluate to a function
- tail-binding
a-symbol
[a destructuring & form]
- method-dispatch
- (
:http-method-keyword shorthand-or-handler)+ ; method-based dispatch, :http-method-keyword are lowercase and can also be :any
- shorthand-or-handler
[handler-body]
{method-dispatch}
"a-string"
a-symbol ; must evaluate to a handler
(some clojure code) ; must evaluate to a handler