def call(env)
      request = ActionDispatch::Request.new(env)

      if request.post?
        response = parse_incoming_event(request.params)
      else
        response = open_connection(request)
      end

      response
    rescue InvalidConnectionError
      BadRequestResponse
    end
def call(env)
      request = ActionDispatch::Request.new(env)

      if request.post?
        response = parse_incoming_event(request.params)
      else
        response = open_connection(request)
      end

      response
    rescue InvalidConnectionError
      BadRequestResponse
    end
Primary entry point for the Rack application