(app-handler {:keys [broker] :as console-opts} req)
A Ring handler that sets up the necessary middleware and serves Goose Console UI It takes two arguments:
:console-opts
: A map containing the configuration options for the console
:route-prefix
: The route path that exposes the Goose Console via app-handler (should not include a trailing "/")
:broker
: Message broker that transfers message from Producer to Consumer.
Given value must implement goose.broker/Broker
protocol.
Message Broker wiki
:app-name
: Name of the application using Goose
:req
: The Ring request map representing the incoming HTTP request.
A Ring handler that sets up the necessary middleware and serves Goose Console UI It takes two arguments: ### Keys `:console-opts` : A map containing the configuration options for the console \ `:route-prefix` : The route path that exposes the Goose Console via app-handler (should not include a trailing "/") \ `:broker` : Message broker that transfers message from Producer to Consumer. Given value must implement [[goose.broker/Broker]] protocol. [Message Broker wiki](https://github.com/nilenso/goose/wiki/Message-Brokers) `:app-name` : Name of the application using Goose `:req` : The Ring request map representing the incoming HTTP request.
(header header-items {:keys [app-name prefix-route uri] :or {app-name ""}})
Creates a navbar header in hiccup syntax with goose logo and app name
header-items
: A seq of maps each containing route and label keys to
specify navigation links
data
: A map that should include:
- uri
: The current page's URI to identify the active link
- app-name
: Application's name
- prefix-route
: Function to prepend paths for URL generation
Creates a navbar header in hiccup syntax with goose logo and app name ### Args `header-items` : A seq of maps each containing route and label keys to specify navigation links `data` : A map that should include: - `uri`: The current page's URI to identify the active link - `app-name`: Application's name - `prefix-route`: Function to prepend paths for URL generation
(layout & components)
Generates HTML layout for webpage using provided hiccup components
components: A variadic list of functions. Each function is expected to accept
a map data
and return hiccup data representing part of a webpage
(def job [job]
[:p {:class "job"} (:id job)])
(let [view (layout job)]
(view "Jobs page" {:id "jid"})
Generates HTML layout for webpage using provided hiccup components ### Args components: A variadic list of functions. Each function is expected to accept a map `data` and return hiccup data representing part of a webpage ### Usage ```Clojure (def job [job] [:p {:class "job"} (:id job)]) (let [view (layout job)] (view "Jobs page" {:id "jid"}) ```
(not-found _)
A default not found response
A default not found response
(redirect-to-home-page {:keys [prefix-route]})
Redirects the user to the home page using given prefix-route function
Redirects the user to the home page using given prefix-route function
(wrap-method-override handler)
Middleware to override HTTP method based on the _method
parameters in request params, allowing
to simulate PUT, DELETE, PATCH etc. methods that are not supported in HTML forms
Middleware to override HTTP method based on the `_method` parameters in request params, allowing to simulate PUT, DELETE, PATCH etc. methods that are not supported in HTML forms
(wrap-prefix-route handler)
Middleware that injects a prefix-route
function into the request,
that facilitates URL construction in views by prepending given route-prefix to paths
Middleware that injects a `prefix-route` function into the request, that facilitates URL construction in views by prepending given route-prefix to paths
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close