class
Amber::Router::Router
- Amber::Router::Router
- Reference
- Object
Overview
This is the main application handler all routers should finally hit this handler.
Defined in:
amber/router/router.crConstant Summary
-
PATH_EXT_REGEX =
Controller::Helpers::Responders::Content::TYPE_EXT_REGEX
Constructors
Instance Method Summary
- #add(route : Route)
- #add_socket_route(route, handler : WebSockets::Server::Handler)
-
#all_routes : Array(RouteInfo)
Returns all registered routes as RouteInfo structs for introspection.
- #draw(valve : Symbol, namespace : String, &)
-
#draw(valve : Symbol, &)
This registers all the routes for the application
- #get_socket_handler(request) : WebSockets::Server::Handler
- #match(http_verb, resource) : RoutedResult(Route)
- #match_by_controller_action(controller, action)
-
#match_by_name(name : Symbol) : Route | Nil
Looks up a named route by its symbol name.
- #match_by_request(request)
- #route_defined?(request)
-
#route_table : String
Returns a formatted route table string suitable for display.
-
#route_table_for(routes : Array(RouteInfo)) : String
Returns a formatted route table string for a given list of routes.
- #routes : Amber::Router::RouteSet(Amber::Route)
- #routes=(routes : Amber::Router::RouteSet(Amber::Route))
- #routes_hash : Hash(String, Amber::Route)
- #routes_hash=(routes_hash : Hash(String, Amber::Route))
- #scope : Amber::Router::Scope
- #scope=(scope : Amber::Router::Scope)
- #socket_route_defined?(request)
- #socket_routes : Array({path: String, handler: Amber::WebSockets::Server::Handler})
- #socket_routes=(socket_routes : Array(NamedTuple(path: String, handler: Amber::WebSockets::Server::Handler)))
Constructor Detail
Instance Method Detail
Returns all registered routes as RouteInfo structs for introspection.
Looks up a named route by its symbol name.
Returns a formatted route table string suitable for display.
Returns a formatted route table string for a given list of routes.
def socket_routes=(socket_routes : Array(NamedTuple(path: String, handler: Amber::WebSockets::Server::Handler)))
#