Module for creating a ring router (a function that receives a ring requests and dispatches to a handler function based on the request's URL). It ties together the sugar for defining reitit routes and liberator handlers.
The module uses routes produced by
sweet-tooth.endpoint.routes.reitit/expand-routes
. These routes
contain metadata that allow the module to look up vars that define
liberator handlers. The module is responsible for associating routes
with handlers.
The module is also responsible for adding each handler's configuration to the system's integrant configuration, reducing boilerplate for the developer.
We derive handler keys from ::handler
. We then define
ig/init-key
methods for those keywords, where the method returns a
handler function.
This module serves Sweet Tooth's goal of reducing the boilerplate required to get a system running, reducing the potential for errors and allowing the developer to focus on what's unique to their application.
Module for creating a ring router (a function that receives a ring requests and dispatches to a handler function based on the request's URL). It ties together the sugar for defining reitit routes and liberator handlers. The module uses routes produced by `sweet-tooth.endpoint.routes.reitit/expand-routes`. These routes contain metadata that allow the module to look up vars that define liberator handlers. The module is responsible for associating routes with handlers. The module is also responsible for adding each handler's configuration to the system's integrant configuration, reducing boilerplate for the developer. We derive handler keys from `::handler`. We then define `ig/init-key` methods for those keywords, where the method returns a handler function. This module serves Sweet Tooth's goal of reducing the boilerplate required to get a system running, reducing the potential for errors and allowing the developer to focus on what's unique to their application.
(add-handler-defaults route)
Compose configuration used for handler components, used to create liberator handlers
Compose configuration used for handler components, used to create liberator handlers
(add-route-defaults route)
Compose the final route passed to reitit/router
Compose the final route passed to reitit/router
(liberator-resources
{:keys [decisions ctx :sweet-tooth.endpoint.routes.reitit/type
:sweet-tooth.endpoint.module.liberator-reitit-router/path]
:as endpoint-opts})
Return liberator resource handler for a route type
Return liberator resource handler for a route type
(ns-route? route)
differentiate 'normal' routes from those generated by
err/expand-routes
differentiate 'normal' routes from those generated by `err/expand-routes`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close