class Sinatra::Base
def run!(options = {}, &block)
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 = {}, &block) return if running? set options handler = detect_rack_handler handler_name = handler.name.gsub(/.*::/, '') server_settings = settings.respond_to?(:server_settings) ? settings.server_settings : {} server_settings.merge!(:Port => port, :Host => bind) begin start_server(handler, server_settings, handler_name, &block) rescue Errno::EADDRINUSE $stderr.puts "== Someone is already performing on port #{port}!" raise ensure quit! end end