rack.git  about / heads / tags
a modular Ruby webserver interface
blob fe4f0b0948756c7ced3774be889fe1942d49ed68 424 bytes (raw)
$ git show no-unicorn:example/protectedlobster.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 
# frozen_string_literal: true

require 'rack'
require 'rack/lobster'

lobster = Rack::Lobster.new

protected_lobster = Rack::Auth::Basic.new(lobster) do |username, password|
  Rack::Utils.secure_compare('secret', password)
end

protected_lobster.realm = 'Lobster 2.0'

pretty_protected_lobster = Rack::ShowStatus.new(Rack::ShowExceptions.new(protected_lobster))

Rack::Server.start app: pretty_protected_lobster, Port: 9292

git clone https://yhbt.net/rack.git