class Sinatra::Base
def run!(options = {}, &block)
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 = Rack::Handler.pick(server) 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