class Madness::ServerBase

The base class for the sinatra server. Initialize what we can here, but since there are values that will become known only later, the prepare method is provided.

Public Class Methods

prepare() click to toggle source
# File lib/madness/server_base.rb, line 26
def prepare
  set :bind, config.bind
  set :port, config.port
  set :views, theme.views_path

  set_basic_auth if config.auth
end
set_basic_auth() click to toggle source
# File lib/madness/server_base.rb, line 34
def set_basic_auth
  use Rack::Auth::Basic, config.auth_zone do |username, password|
    config.auth.split(':') == [username, password]
  end
end