Created
August 19, 2010 15:35
-
-
Save raul/538167 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # 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