class Amber::Router::Router

Overview

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

Defined in:

amber/router/router.cr

Constant Summary

PATH_EXT_REGEX = Controller::Helpers::Responders::Content::TYPE_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, namespace : String, &) #

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

This registers all the routes for the application


[View source]
def get_socket_handler(request) : WebSockets::Server::Handler #

[View source]
def match(http_verb, resource) : 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(Amber::Route) #

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

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

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

[View source]
def scope : Amber::Router::Scope #

[View source]
def scope=(scope : Amber::Router::Scope) #

[View source]
def socket_route_defined?(request) #

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

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

[View source]