class

Kemal::RouteHandler

Inherits HTTP::Handler < Reference < Object

Constants

INSTANCE = new

Constructors

Instance methods

add_route(method : String, path : String, &handler : HTTP::Server::Context -> _)

Adds a given route to routing tree.

Source
cached_routes
Source
cached_routes=(cache : LRUCache(String, Radix::Result(Route)))

Setter is synchronized for thread-safety when specs reset the cache.

Source
lookup_route(verb : String, path : String)

Looks up the route from the Radix::Tree for the first time and caches to improve performance. Cache access is synchronized so multiple fibers can call this concurrently.

Source
routes
Source
routes=(routes : Radix::Tree(Kemal::Route))
Source