Created
May 4, 2016 11:01
-
-
Save adamluzsi/2f506ee18a3d9c330c2119a6736312bc to your computer and use it in GitHub Desktop.
Rack::App with basic auth
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
require 'rack/app' | |
class App < Rack::App | |
middlewares do |b| | |
b.use Rack::Auth::Basic, "Restricted Area" do |username, password| | |
[username, password] == ['admin', 'admin'] | |
end | |
end | |
desc 'example static endpoint' | |
get '/' do | |
'hello world Rack::App' | |
end | |
end | |
run App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment