Declaring routers
Routers are functions that are added as interceptors to the chain to analyze the requests based on the defined Routes. Pedestal creates a router based on the values of :io.pedestal.http/routes and :io.pedestal.http/router keys, as specified in the service map (http://pedestal.io/reference/service-map). The service map contains all the details for Pedestal to create a service including a router, routes, chain-provider properties, and more. It acts as a builder (https://en.wikipedia.org/wiki/Builder_pattern) for Pedestal services.
Pedestal provides three built-in routers that can be specified using the :map-tree, :prefix-tree, and :linear-search keywords. The :map-tree is the default router that has constant time complexity ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access