All Projects → mattt → rack-subdomain

mattt / rack-subdomain

Licence: MIT License
Rack middleware to transparently route requests with a subdomain to a specified path with substitutions

Programming Languages

ruby
36898 projects - #4 most used programming language

rack-subdomain

Rack middleware to transparently route requests with a subdomain to a specified path with substitutions.

Usage

Gemfile

gem 'rack-subdomain'

config.ru

# Simple Example

use Rack::Subdomain, "example.com", to: "/users/:subdomain"

# Complex Example
use Rack::Subdomain, "example.com", except: ['', 'www', 'secure'] do
  map 'downloads', to: "/downloads/:subdomain"
  map '*', to: "/users/:subdomain"
end

Contact

Mattt

License

rack-subdomain is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].