Skip to content

Instantly share code, notes, and snippets.

@raul
Created August 19, 2010 15:35
Show Gist options
  • Select an option

  • Save raul/538167 to your computer and use it in GitHub Desktop.

Select an option

Save raul/538167 to your computer and use it in GitHub Desktop.
# config.ru
class RackApp
def call(env)
[200, {'Content-Type' => 'text/plain'}, ["Hello world!"]]
end
end
class AdminRackApp
def call(env)
[200, {'Content-Type' => 'text/html'}, ["Hello world from my Admin area!"]]
end
end
map "/" do
run RackApp.new
end
map "/admin" do
use Rack::Auth::Basic, "Admin area" do |username, password|
[username, password] == ['foo', 'bar']
end
run AdminRackApp.new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment