Created
September 5, 2011 14:52
-
-
Save ferblape/1195166 to your computer and use it in GitHub Desktop.
Toldo web page
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
# http://thetoldo.com | |
use Rack::Static, :urls => ["/images/"] | |
run Proc.new { |env| | |
language = env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first | |
index_file = (language == 'es') ? "index.es.html" : "index.en.html" | |
[200, {'Content-Type'=>'text/html'}, File.open(index_file, 'r')] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment