class Kemal::RouteHandler
- Kemal::RouteHandler
- Reference
- Object
Included Modules
- HTTP::Handler
Defined in:
kemal/route_handler.crConstant Summary
-
CACHED_ROUTES_LIMIT =
1024
-
INSTANCE =
new
Constructors
Instance Method Summary
-
#add_route(method : String, path : String, &handler : HTTP::Server::Context -> _)
Adds a given route to routing tree.
- #cached_routes : Hash(String, Radix::Result(Kemal::Route))
- #cached_routes=(cached_routes)
- #call(context : HTTP::Server::Context)
-
#lookup_route(verb : String, path : String)
Looks up the route from the Radix::Tree for the first time and caches to improve performance.
- #routes : Radix::Tree(Kemal::Route)
- #routes=(routes)
Constructor Detail
Instance Method Detail
def add_route(method : String, path : String, &handler : HTTP::Server::Context -> _)
#
Adds a given route to routing tree. As an exception each GET
route additionaly defines
a corresponding HEAD
route.
def lookup_route(verb : String, path : String)
#
Looks up the route from the Radix::Tree for the first time and caches to improve performance.