class Sinatra::Base

def run!(options = {})

with the constructed handler once we have taken the stage.
Thin, Puma, Mongrel, or WEBrick (in that order). If given a block, will call
Run the Sinatra app as a self-hosted server using
def run!(options = {})
  set options
  handler         = detect_rack_handler
  handler_name    = handler.name.gsub(/.*::/, '')
  server_settings = settings.respond_to?(:server_settings) ? settings.server_settings : {}
  handler.run self, server_settings.merge(:Port => port, :Host => bind) do |server|
    unless handler_name =~ /cgi/i
      $stderr.puts "== Sinatra/#{Sinatra::VERSION} has taken the stage " +
      "on #{port} for #{environment} with backup from #{handler_name}"
    end
    [:INT, :TERM].each { |sig| trap(sig) { quit!(server, handler_name) } }
    server.threaded = settings.threaded if server.respond_to? :threaded=
    set :running, true
    yield server if block_given?
  end
rescue Errno::EADDRINUSE
  $stderr.puts "== Someone is already performing on port #{port}!"
end