(annotated-routes {:keys [body request-method uri] :as req})When uri resolves to a servable function to call. Negotiates body based on content-type and accept headers when present, defaults to JSON otherwise, or HTML when ends with .html or :html present in metadata.
When uri resolves to a servable function to call. Negotiates body based on content-type and accept headers when present, defaults to JSON otherwise, or HTML when ends with .html or :html present in metadata.
(call-annotated-endpoint req func)Processes a servable or handler request.
Will apply args from params of the request if present,
or call the function with params as an argument.
Response will be HTML if the result is a string and the function name ends in the html suffix.
Processes a servable or handler request. Will apply `args` from `params` of the request if present, or call the function with `params` as an argument. Response will be HTML if the result is a string and the function name ends in the `html` suffix.
(clay-routes {:keys [body request-method uri] :as req})Clay's built in web server routes.
Clay's built in web server routes.
(communication-script {:keys [port counter]})The communication JS script to init a WebSocket to the server.
The communication JS script to init a WebSocket to the server.
(install-handler! handler-var)Adds a ring request handler to Clay's built in server.
Handlers are functions that take a request and return a response, or nil if not handled.
handler-var should be a var that derefs to a handler.
Using a var makes installation idempotent and dynamic.
Adds a ring request handler to Clay's built in server. Handlers are functions that take a request and return a response, or nil if not handled. `handler-var` should be a var that derefs to a handler. Using a var makes installation idempotent and dynamic.
(install-websocket-handler! event-type handler-var)Adds a httpkit websocket handler to Clay's built in server.
event-type :on-receive should be a var that derefs to a function taking channel and message.
Using a var makes installation idempotent and dynamic.
Adds a httpkit websocket handler to Clay's built in server. `event-type` :on-receive should be a var that derefs to a function taking channel and message. Using a var makes installation idempotent and dynamic.
(live-namespace-routes {:keys [uri]})When the uri resolves to a servable namespace
When the uri resolves to a servable namespace
routes is a handler, the name is kept for backwards compatibility.
Will be bound when open is first called, as it requires configuration.
`routes` is a handler, the name is kept for backwards compatibility. Will be bound when open is first called, as it requires configuration.
(scittle-eval-string! code)Send ClojureScript code to be evaluated on the Clay page. The code will be executed directly using scittle.core.eval_string.
Send ClojureScript code to be evaluated on the Clay page. The code will be executed directly using scittle.core.eval_string.
(update-page! {:as spec
:keys [show base-target-path page full-target-path]
:or {full-target-path (str base-target-path "/" ".clay.html")}})(wrap-base-url html
{:as state
{:keys [flatten-targets full-target-path base-target-path]}
:last-rendered-spec})cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |