def call(env)
      headers = {}
      path = Rack::Request.new(env).path
      if path =~ /\.json$/
        headers["Content-Type"] = "application/json"
        format = :json
      elsif path =~ /\.txt$/
        headers["Content-Type"] = "text/plain"
        format = :text
      else
        headers["Content-Type"] = "text/html"
        format = :html
      end
      begin
        body = Statusz.render_from_json(@filename, format, @extra_fields)
      rescue StandardError => error
        return [500, { "Content-Type" => "text/plain" }, ["Error with statusz:\n#{error.message}"]]
      end
      [200, headers, [body]]
    end
def call(env)
      headers = {}
      path = Rack::Request.new(env).path
      if path =~ /\.json$/
        headers["Content-Type"] = "application/json"
        format = :json
      elsif path =~ /\.txt$/
        headers["Content-Type"] = "text/plain"
        format = :text
      else
        headers["Content-Type"] = "text/html"
        format = :html
      end
      begin
        body = Statusz.render_from_json(@filename, format, @extra_fields)
      rescue StandardError => error
        return [500, { "Content-Type" => "text/plain" }, ["Error with statusz:\n#{error.message}"]]
      end
      [200, headers, [body]]
    end
Set up the Statusz::Server Rack app.

 @param [String] filename the json statusz file written at deploy time. If `filename` is `nil`, then
                          statusz will output an html file containing only the fields in `extra_fields`.
 @param [Hash] extra_fields extra key/value pairs to include in the output.
 The usual Rack app call method.