class Sinatra::Base

def start_server(handler, server_settings, handler_name)

Starts the server by running the Rack Handler.
def start_server(handler, server_settings, handler_name)
  # Ensure we initialize middleware before startup, to match standard Rack
  # behavior, by ensuring an instance exists:
  prototype
  # Run the instance we created:
  handler.run(self, server_settings) do |server|
    unless suppress_messages?
      $stderr.puts "== Sinatra (v#{Sinatra::VERSION}) has taken the stage on #{port} for #{environment} with backup from #{handler_name}"
    end
    setup_traps
    set :running_server, server
    set :handler_name,   handler_name
    server.threaded = settings.threaded if server.respond_to? :threaded=
    yield server if block_given?
  end
end