class Picnic::Server::Base

Public Instance Methods

app() click to toggle source
# File lib/picnic/server.rb, line 26
def app
  reload!
   
  rapp =  apps.values.first

  rapp = Rack::Static.new(rapp, @conf[:static]) if @conf[:static]

  if @conf.uri_path
    rapp = Rack::URLMap.new(@conf.uri_path => rapp)
  end

  rapp = Rack::ContentLength.new(rapp)
  rapp = Rack::Lint.new(rapp)
  rapp = Camping::Server::XSendfile.new(rapp)
  rapp = Rack::ShowExceptions.new(rapp)
end
start() click to toggle source
# File lib/picnic/server.rb, line 5
def start
  handler, conf = case @conf.server
  when "console"
    ARGV.clear
    IRB.start
    exit
  when "mongrel"
    prep_mongrel
  when "webrick"
    prep_webrick
  end

  # preload the apps in order to show any startup errors when
  # the app is run from the command line (otherwise they would only
  # show up after the first request to the web server)
  reload!
        
  handler.run(self, conf) 
end