class Alfodr::Router::Router

Overview

This is the main application handler all routers should finally hit this handler.

Defined in:

alfodr/router/router.cr

Constant Summary

PATH_EXT_REGEX = /\.[^$\/]+$/

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def add(route : Route) #

[View source]
def add_socket_route(route, handler : WebSockets::Server::Handler) #

[View source]
def draw(valve : Symbol, scope : String, &) #

[View source]
def draw(valve : Symbol, &) #

This registers all the routes for the application


[View source]
def get_socket_handler(request) #

[View source]
def match(http_verb, resource) : Amber::Router::RoutedResult(Route) #

[View source]
def match_by_controller_action(controller, action) #

[View source]
def match_by_request(request) #

[View source]
def route_defined?(request) #

[View source]
def routes : Amber::Router::RouteSet(Alfodr::Route) #

[View source]
def routes=(routes : Amber::Router::RouteSet(Alfodr::Route)) #

[View source]
def routes_hash : Hash(String, Alfodr::Route) #

[View source]
def routes_hash=(routes_hash : Hash(String, Alfodr::Route)) #

[View source]
def socket_route_defined?(request) #

[View source]
def socket_routes : Array({path: String, handler: Alfodr::WebSockets::Server::Handler}) #

[View source]
def socket_routes=(socket_routes : Array(NamedTuple(path: String, handler: Alfodr::WebSockets::Server::Handler))) #

[View source]