Skip to content
Rack middleware to transparently route requests with a subdomain to a specified path with substitutions
Ruby
Find file
Latest commit e6ae069 Nov 16, 2013 @mattt Adding .gitignore
Failed to load latest commit information.
lib
.gitignore
Gemfile
LICENSE
README.md
Rakefile
rack-subdomain.gemspec

README.md

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 Thompson

License

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

Something went wrong with that request. Please try again.