class

Via::Routing::Router

Inherits Reference < Object

Selects a route without depending on HTTP server or client types.

Paths use segment-aware prefix matching. The longest matching path wins; for equal paths an exact host route wins over a hostless route. Remaining ties preserve configuration order.

Constructors

new(routes : Enumerable(Route))
Source

Class methods

normalize_hostname(hostname : String) : String
Source
normalize_request_host(authority : String | Nil) : String | Nil
Source

Instance methods

match(host : String | Nil, path : String) : Route | Nil
Source