Permalink
Browse files

An example of how to use Rack::Auth::Basic. Protect your lobsters!

darcs-hash:20070403205605-5d7f7-f97e4926fe57056d7be65c001391978ce26dd542.gz
  • Loading branch information...
1 parent 9879a29 commit d46031f67c2b6269f204b6c3bbd2b80edecc2de7 @tim tim committed Apr 3, 2007
Showing with 14 additions and 0 deletions.
  1. +14 −0 example/protectedlobster.rb
View
14 example/protectedlobster.rb
@@ -0,0 +1,14 @@
+require 'rack'
+require 'rack/lobster'
+
+lobster = Rack::Lobster.new
+
+protected_lobster = Rack::Auth::Basic.new(lobster) do |username, password|
+ 'secret' == password
+end
+
+protected_lobster.realm = 'Lobster 2.0'
+
+pretty_protected_lobster = Rack::ShowStatus.new(Rack::ShowExceptions.new(protected_lobster))
+
+Rack::Handler::WEBrick.run pretty_protected_lobster, :Port => 9292

0 comments on commit d46031f

Please sign in to comment.