Application Description Language support - functions useful in generating JSON route handlers.
Application Description Language support - functions useful in generating JSON route handlers.
(do-or-server-fail form status)
Evaluate this form
; if it succeeds, return an HTTP response with this
status code and the JSON-formatted result as body; if it fails, return an
HTTP 500 response.
Evaluate this `form`; if it succeeds, return an HTTP response with this status code and the JSON-formatted result as body; if it fails, return an HTTP 500 response.
(if-valid-user form request)
(if-valid-user form request error-return)
Evaluate this form
only if there is a valid user in the session of
this request
; otherwise return the error-return
value.
Evaluate this `form` only if there is a valid user in the session of this `request`; otherwise return the `error-return` value.
(valid-user-or-forbid form request)
Evaluate this form
only if there is a valid user in the session of
this request
; otherwise return an HTTP forbidden response.
Evaluate this `form` only if there is a valid user in the session of this `request`; otherwise return an HTTP forbidden response.
(with-params-or-error form params required)
Evaluate this form
only if these params
contain all these required
keys;
otherwise return an HTTP 400 response.
Evaluate this `form` only if these `params` contain all these `required` keys; otherwise return an HTTP 400 response.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close