Whether to tap> hook invocations, requests, etc. for debugging purposes. Default false.
Whether to tap> hook invocations, requests, etc. for debugging purposes. Default false.
DEPRECATED. Use enable-profiling instead.
DEPRECATED. Use *enable-profiling* instead.
(add-effect req e)Adds e as an Effect to be run during the apply-effects lifecycle phase.
Adds e as an Effect to be run during the apply-effects lifecycle phase.
(add-profiler f)Wraps f in a fn that first checks that its sole arg is a valid profiling event, and if so, calls f with its arg. Calls add-tap with the resulting wrapper fn. Returns wrapper for use with remove-tap.
Wraps f in a fn that first checks that its sole arg is a valid profiling event, and if so, calls f with its arg. Calls add-tap with the resulting wrapper fn. Returns wrapper for use with remove-tap.
(app)(app {:keys [plugins]})Creates a new Bread app. Optionally accepts an options map. A single option is supported, :plugins, a sequence of plugins to load.
Creates a new Bread app. Optionally accepts an options map. A single option is supported, :plugins, a sequence of plugins to load.
(config app k)(config app k default)Returns app's config value for k. Returns the (optionally) provided default if k is not found in app's config map. If k is not found and not default is provided, returns nil.
Returns app's config value for k. Returns the (optionally) provided default if k is not found in app's config map. If k is not found and not default is provided, returns nil.
(handle app req)Takes a Ring request and threads it through the Bread request/response lifecycle.
Takes a Ring request and threads it through the Bread request/response lifecycle.
(handler app)Returns a handler function that takes a Ring request and threads it through the Bread request/response lifecycle.
Returns a handler function that takes a Ring request and threads it through the Bread request/response lifecycle.
(hook app h)(hook app h x)(hook app h x & args)Threads app and any (optional) args through any actions for hook h. Calls (action app current-action ...) on successive actions for the given hook, in the order they were added. When passed only two args (an app and a hook), calls (action app current-action nil) repeatedly, returning the modified app. When called with three or more args, calls (action app current-action ...args) repeatedly, returning the (presumably modified) third arg. Note that by convention, actions corresponding to hooks that are called with three or more args operate on - and return modified versions of - the third arg, but this is not enforced.
Threads app and any (optional) args through any actions for hook h. Calls (action app current-action ...) on successive actions for the given hook, in the order they were added. When passed only two args (an app and a hook), calls (action app current-action nil) repeatedly, returning the modified app. When called with three or more args, calls (action app current-action ...args) repeatedly, returning the (presumably modified) third arg. Note that by convention, actions corresponding to hooks that are called with three or more args operate on - and return modified versions of - the third arg, but this is not enforced.
(load-app app)Loads the given app by calling bootstrap, load-plugins, and init hooks.
Loads the given app by calling bootstrap, load-plugins, and init hooks.
(profile* t e)(profile> t e)(response req raw)Returns a response with the current app (req) merged into raw map, preserving any hooks/config added to req.
Returns a response with the current app (req) merged into raw map, preserving any hooks/config added to req.
(path this route-name params)(route-dispatcher this req)(route-params this req)(route-spec this req)(routes this)(set-config app k v & extra)Sets app's config value for k to v, and so on for any subsequent key/value pairs. Works like assoc.
Sets app's config value for k to v, and so on for any subsequent key/value pairs. Works like assoc.
(shutdown app)Shuts down the app, removing all ::systems.bread* keys. Runs the ::shutdown hook, which is useful e.g. for unmounting long-lived application state.
Shuts down the app, removing all ::systems.bread* keys. Runs the ::shutdown hook, which is useful e.g. for unmounting long-lived application state.
(value->expansion k value & {desc :expansion/description})cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |