Liking cljdoc? Tell your friends :D

org.purefn.kurosawa.web.app

A component for web apps that need access to services (stateful components.) It mainly functions as a container for all the components that the web app handlers need. It provides a middleware to inject those components into ring requests.

To use, initialize by calling app with a config map (unused for now) and a handler function. In your component system map, add any other components that your app needs. Call app-handler with the app component to return a handler wrapped in a middleware that will inject all the components into the request map, under a ::services key, keyed by the same keys specified in the system map.

Handlers can use the service helper function to fetch a particular service out of a request map.

A component for web apps that need access to services (stateful
components.) It mainly functions as a container for all the
components that the web app handlers need. It provides a middleware
to inject those components into ring requests.

To use, initialize by calling `app` with a config map (unused for
now) and a handler function. In your component system map, add any
other components that your app needs. Call `app-handler` with the
app component to return a handler wrapped in a middleware that will
inject all the components into the request map, under a
`::services` key, keyed by the same keys specified in the system map.

Handlers can use the `service` helper function to fetch a
particular service out of a request map.
raw docstring

Appclj

source

appclj

(app config handler)

Returns an App record with provided config and handler.

Returns an App record with provided config and handler.
sourceraw docstring

app-handlerclj

(app-handler app)

Main API function. Builds handler function from app.

Main API function. Builds handler function from app.
sourceraw docstring

default-configclj

(default-config)
(default-config name)

As much of the default configuration as can be determined from the current runtime environment.

  • name The root of the ConfigMap and Secrets directory. Defaults to app if not provided.
As much of the default configuration as can be determined from the current
runtime environment.

- `name` The root of the ConfigMap and Secrets directory.  Defaults to 
`app` if not provided.
sourceraw docstring

serviceclj

(service req service-k)

Returns a service from a request map. Helper function for handlers to pull out services assoced in by wrap-services middleware.

Returns a service from a request map. Helper function for handlers
to pull out services assoced in by `wrap-services` middleware.
sourceraw docstring

wrap-servicesclj

(wrap-services h services)

Middleware that wraps a handler with given services map.

Middleware that wraps a handler with given services map.
sourceraw docstring

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

× close