require 'sinatra/base' run Sinatra.new { get('/') do content_type "text/plain" # you can also use Rack::ContentType # with Sinatra except here we want # more control since Sinatra gives it # to us. Rack::ContentType sets the # Content-Type on every route/url for # the current mapping. request.env['REMOTE_ADDR'].split(",").first end }