Skip to content

Instantly share code, notes, and snippets.

@ferblape
Created September 5, 2011 14:52
Show Gist options
  • Save ferblape/1195166 to your computer and use it in GitHub Desktop.
Save ferblape/1195166 to your computer and use it in GitHub Desktop.
Toldo web page
# 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