-
-
Save akahn/349309 to your computer and use it in GitHub Desktop.
karmi rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Match subdomain for a Sinatra route | |
# cz.application.local:4567 => 200 0K | |
# en.application.local:4567 => 404 Not Found | |
# In your /etc/hosts: | |
# 127.0.0.1 cz.application.local | |
# 127.0.0.1 en.application.local | |
require 'rubygems' | |
require 'sinatra' | |
def subdomain(host) | |
condition { host == request.env['HTTP_HOST'].split('.').first } | |
end | |
get '/', :subdomain => 'cz' do | |
"You got yourself a CZ!" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment