(as-resource _)
Coerce to a resource. Often, resources need to be coerced rather than extending types directly with the Resource protocol. We can exploit the time of coercion to know the time of birth for the resource, which supports time-based conditional requests. For example, a simple StringResource is immutable, so by knowing the time of construction, we can precisely state its Last-Modified-Date.
Coerce to a resource. Often, resources need to be coerced rather than extending types directly with the Resource protocol. We can exploit the time of coercion to know the time of birth for the resource, which supports time-based conditional requests. For example, a simple StringResource is immutable, so by knowing the time of construction, we can precisely state its Last-Modified-Date.
(charset ctx)
(content-type ctx)
(get-host-origin req)
(handler resource)
(handler resource options)
Create a Ring handler
Create a Ring handler
(language ctx)
(listener routes & [aleph-options])
Start an HTTP listener on a given port. If not specified, listener will be started on any available port. Returns {:port port :close fn}
Start an HTTP listener on a given port. If not specified, listener will be started on any available port. Returns {:port port :close fn}
(redirect first-arg & args)
There are 2 different redirects in yada, one to construct a redirecting resource, the other, to be used in a response function to augment a yada context. Since we want the function name to be 'redirect', this proxy function delegates to the correct implementation.
There are 2 different redirects in yada, one to construct a redirecting resource, the other, to be used in a response function to augment a yada context. Since we want the function name to be 'redirect', this proxy function delegates to the correct implementation.
(request-for method uri options)
(resource model)
(response-for o)
(response-for o method)
(response-for o method uri)
(response-for o method uri options)
Produces yada responses for a number of types. Maps are interpreted as resource-maps, vectors are bidi routes. If you want these as bodies, use (response-for {:response …})
Produces yada responses for a number of types. Maps are interpreted as resource-maps, vectors are bidi routes. If you want these as bodies, use (response-for {:response …})
(routes routes & [{:keys [pre post] :or {pre identity post identity}}])
Process a route structure, interpretting any 'naked' maps in the Matched position as resource-models and converting them into resources. A pre-processing function can be provided that will be called on each naked map prior to the map being turned into a resource (with consequent schema checking). A post-processing function can also be provided that will post-process the actual resource records, after the schema check.
Process a route structure, interpretting any 'naked' maps in the Matched position as resource-models and converting them into resources. A pre-processing function can be provided that will be called on each naked map prior to the map being turned into a resource (with consequent schema checking). A post-processing function can also be provided that will post-process the actual resource records, after the schema check.
(safe-relative-file parent path)
(safe-relative-path parent path)
Given a parent java.nio.file.Path, return a child that is guaranteed not to ascend the parent. This is to ensure access cannot be made to files outside of the parent root.
Given a parent java.nio.file.Path, return a child that is guaranteed not to ascend the parent. This is to ensure access cannot be made to files outside of the parent root.
(set-cookie ctx id val)
Take a cookie defined in the resource and set it on the response.
Take a cookie defined in the resource and set it on the response.
(unset-cookie ctx id)
Take a cookie defined in the resource and expire it
Take a cookie defined in the resource and expire it
(uri-info ctx handler & [options])
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close