Liking cljdoc? Tell your friends :D

scicloj.clay.v2.server


*make-html-pageclj

source

*stop-server!clj

source

all-routesclj

(all-routes req)
source

annotated-routesclj

(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.
sourceraw docstring

broadcast!clj

(broadcast! msg)
source

browse!clj

(browse!)
source

call-annotated-endpointclj

(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.
sourceraw docstring

clay-handlerclj

(clay-handler {:keys [site-defaults]})
source

clay-routesclj

(clay-routes {:keys [body request-method uri] :as req})

Clay's built in web server routes.

Clay's built in web server routes.
sourceraw docstring

clear-handlers!clj

(clear-handlers!)
source

clear-websocket-handlers!clj

(clear-websocket-handlers!)
source

close!clj

(close!)
source

communication-scriptclj

(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.
sourceraw docstring

core-http-serverclj

(core-http-server port)
source

default-portclj

source

encode?clj

(encode? _ response)
source

get-free-portclj

(get-free-port)
source

(header state)
source

install-handler!clj

(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.
sourceraw docstring

install-websocket-handler!clj

(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.
sourceraw docstring

live-namespace-routesclj

(live-namespace-routes {:keys [uri]})

When the uri resolves to a servable namespace

When the uri resolves to a servable namespace
sourceraw docstring

loading!clj

(loading!)
source

open!clj

(open!)
(open! {:as opts :keys [port browse ide]})
source

pageclj

(page)
(page state)
source

portclj

(port)
source

port->urlclj

(port->url port)
source

resolve-servable-varclj

(resolve-servable-var func)
source

routesclj

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.
sourceraw docstring

scittle-eval-string!clj

(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.
sourceraw docstring

update-page!clj

(update-page! {:as spec
               :keys [show base-target-path page full-target-path]
               :or {full-target-path (str base-target-path "/" ".clay.html")}})
source

uri->filenameclj

(uri->filename uri)
source

urlclj

(url)
source

websocket-handlerclj

source

wrap-base-urlclj

(wrap-base-url html
               {:as state
                {:keys [flatten-targets full-target-path base-target-path]}
                  :last-rendered-spec})
source

wrap-htmlclj

(wrap-html html state)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close