Padrino::Router

Class: Padrino::Router

Inherits:
Object
  • Object

Overview

This class is an extended version of Rack::URLMap.

Padrino::Router like Rack::URLMap dispatches in such a way that the longest paths are tried first, since they are most specific.

Features:

  • Map a path to the specified App

  • Ignore server names (this solve issues with vhost and domain aliases)

  • Use hosts instead of server name for mappings (this help us with our vhost and domain aliases)

Examples:

routes = Padrino::Router.new do
  map(:path => "/", :to => PadrinoWeb, :host => "padrino.local")
  map(:path => "/", :to =&g