Liking cljdoc? Tell your friends :D

full.http.server

Asynchonous HTTP server, based on http-kit and core.async

Asynchonous HTTP server, based on http-kit and core.async
raw docstring

ANYcljmacro

(ANY path args & body)

basic-exception-rendererclj

(basic-exception-renderer ex)

default-loggerclj


defroutescljmacro

(defroutes name & routes)

DELETEcljmacro

(DELETE path args & body)

GETcljmacro

(GET path args & body)

go-try-assoc-endpointcljmacro

(go-try-assoc-endpoint endpoint & body)

handle-exceptions>clj

(handle-exceptions> handler>
                    &
                    {:keys [renderer logger]
                     :or {renderer basic-exception-renderer
                          logger server-error-exception-logger}})

handle-head>clj

(handle-head> handler>)

Middleware for handling HEAD requests in a way that doesn't break Compojure. This workarounds the logic in compojure.core/if-method that breaks when response is channel.

Middleware for handling HEAD requests in a way that doesn't break Compojure.
This workarounds the logic in compojure.core/if-method that breaks when
response is channel.
raw docstring

(HEAD path args & body)

json-apiclj

(json-api routes
          &
          {:keys [exception-logger exception-renderer logger]
           :or {exception-logger server-error-exception-logger
                exception-renderer json-exception-renderer
                logger default-logger}})

json-exception-rendererclj

(json-exception-renderer ex)

json-response>clj

(json-response> handler>)

Middleware that converts responses with a map or a vector for a body into a JSON response.

Middleware that converts responses with a map or a vector for a body into a
JSON response.
raw docstring

log-error-messageclj

(log-error-message ex)

Generate error message that will be written to log.

Generate error message that will be written to log.
raw docstring

log-track-request>clj

(log-track-request> handler> & {:keys [logger] :or {logger default-logger}})

metric-statesclj


normalize-response>clj

(normalize-response> handler>)

OPTIONScljmacro

(OPTIONS path args & body)

PATCHcljmacro

(PATCH path args & body)

POSTcljmacro

(POST path args & body)

PUTcljmacro

(PUT path args & body)

response-error-messageclj

(response-error-message ex)

Generate error message that will be returned in response.

Generate error message that will be returned in response.
raw docstring

response-error-statusclj

(response-error-status ex)

run-serverclj

(run-server handler opts)

send-streaming-responseclj

(send-streaming-response response channel)

server-error-exception-loggerclj

(server-error-exception-logger ex)

wrap-content-type>clj

(wrap-content-type> handler)
(wrap-content-type> handler options)

Middleware that adds a content-type header to the response if one is not set by the handler. Uses the ring.util.mime-type/ext-mime-type function to guess the content-type from the file extension in the URI. If no content-type can be found, it defaults to 'application/octet-stream'.

Accepts the following options:

:mime-types - a map of filename extensions to mime-types that will be used in addition to the ones defined in ring.util.mime-types/default-mime-types

This is async version of wrap-content-type from ring.middleware.content-type: https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/content_type.clj Copyright (c) 2009-2010 Mark McGranaghan

Middleware that adds a content-type header to the response if one is not
set by the handler. Uses the ring.util.mime-type/ext-mime-type function to
guess the content-type from the file extension in the URI. If no
content-type can be found, it defaults to 'application/octet-stream'.

Accepts the following options:

:mime-types - a map of filename extensions to mime-types that will be
              used in addition to the ones defined in
              ring.util.mime-types/default-mime-types

This is async version of wrap-content-type from ring.middleware.content-type:
https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/content_type.clj
Copyright (c) 2009-2010 Mark McGranaghan
raw docstring

wrap-cookies>clj

(wrap-cookies> handler)
(wrap-cookies> handler options)

Parses the cookies in the request map, then assocs the resulting map to the :cookies key on the request.

Accepts the following options:

:decoder - a function to decode the cookie value. Expects a function that takes a string and returns a string. Defaults to URL-decoding.

:encoder - a function to encode the cookie name and value. Expects a function that takes a name/value map and returns a string. Defaults to URL-encoding.

Each cookie is represented as a map, with its value being held in the :value key. A cookie may optionally contain a :path, :domain or :port attribute.

To set cookies, add a map to the :cookies key on the response. The values of the cookie map can either be strings, or maps containing the following keys:

:value - the new value of the cookie :path - the subpath the cookie is valid for :domain - the domain the cookie is valid for :max-age - the maximum age in seconds of the cookie :expires - a date string at which the cookie will expire :secure - set to true if the cookie requires HTTPS, prevent HTTP access :http-only - set to true if the cookie is valid for HTTP and HTTPS only (ie. prevent JavaScript access)

Parses the cookies in the request map, then assocs the resulting map
to the :cookies key on the request.

Accepts the following options:

:decoder - a function to decode the cookie value. Expects a function that
           takes a string and returns a string. Defaults to URL-decoding.

:encoder - a function to encode the cookie name and value. Expects a
           function that takes a name/value map and returns a string.
           Defaults to URL-encoding.

Each cookie is represented as a map, with its value being held in the
:value key. A cookie may optionally contain a :path, :domain or :port
attribute.

To set cookies, add a map to the :cookies key on the response. The values
of the cookie map can either be strings, or maps containing the following
keys:

:value     - the new value of the cookie
:path      - the subpath the cookie is valid for
:domain    - the domain the cookie is valid for
:max-age   - the maximum age in seconds of the cookie
:expires   - a date string at which the cookie will expire
:secure    - set to true if the cookie requires HTTPS, prevent HTTP access
:http-only - set to true if the cookie is valid for HTTP and HTTPS only
             (ie. prevent JavaScript access)
raw docstring

wrap-cors>clj

(wrap-cors> handler & access-control)

wrap-resource>clj

(wrap-resource> handler> root-path)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close