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)
source

basic-exception-rendererclj

(basic-exception-renderer ex)
source

default-loggerclj

source

defroutescljmacro

(defroutes name & routes)
source

DELETEcljmacro

(DELETE path args & body)
source

GETcljmacro

(GET path args & body)
source

go-try-assoc-endpointcljmacro

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

handle-exceptions>clj

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

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

(HEAD path args & body)
source

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}})
source

json-exception-rendererclj

(json-exception-renderer ex)
source

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

log-track-request>clj

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

metric-statesclj

source

normalize-response>clj

(normalize-response> handler>)
source

OPTIONScljmacro

(OPTIONS path args & body)
source

PATCHcljmacro

(PATCH path args & body)
source

POSTcljmacro

(POST path args & body)
source

PUTcljmacro

(PUT path args & body)
source

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

response-error-statusclj

(response-error-status ex)
source

run-serverclj

(run-server handler opts)
source

send-streaming-responseclj

(send-streaming-response response channel)
source

server-error-exception-loggerclj

(server-error-exception-logger ex)
source

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

wrap-cors>clj

(wrap-cors> handler & access-control)
source

wrap-resource>clj

(wrap-resource> handler> root-path)
source

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

× close