class Kemal::RouteHandler

Included Modules

Defined in:

kemal/route_handler.cr

Constant Summary

CACHED_ROUTES_LIMIT = 1024
INSTANCE = new

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

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

Adds a given route to routing tree.


[View source]
def cached_routes : Hash(String, Radix::Result(Kemal::Route)) #

[View source]
def cached_routes=(cached_routes : Hash(String, Radix::Result(Kemal::Route))) #

[View source]
def call(context : HTTP::Server::Context) #

[View source]
def lookup_route(verb : String, path : String) #

Looks up the route from the Radix::Tree for the first time and caches to improve performance.


[View source]
def routes : Radix::Tree(Kemal::Route) #

[View source]
def routes=(routes : Radix::Tree(Kemal::Route)) #

[View source]