arachne.http

Handler

protocol

A Component representing a Ring-style request handler in which the response map is a function of the request map.

Dependencies of a Handler component will be injected into the request map, using their dependency key.

members

handle

(handle this request)
Given a Ring-style request map, return a Ring-style response map

handler-component

(handler-component cfg eid)
Constructor for a `Handler` component. The component must have a `:arachne.http.handler/fn`
attribute indicating the handler function to which the request will be delegated.

url-generator

(url-generator cfg server)
Given a configuration and a server (Arachne ID or entity ID), return a function that will
construct a query string given an endpoint name and an (optional) parameter map.

Usage example:

    (def url-for (url-generator cfg :my/server))

    (url-for :my-route {:n 42})
    ;;=> "/my/route/42"

Returns a higher order function for performance reasons: calling `url-generator` performs an
expensive Datalog query of the configuration, but calls to the returned function are fast.
Therefore you should typically call `url-generator` once, and re-use the result.