addHandler(endpoint, handler) {
    const qs = querystring.decode(endpoint.slice(endpoint.indexOf('?') + 1))
    this.#handlers.set(qs.method, handler)
  }
Adds a new handler for the provided endpoint.

@param {string} endpoint A string like
`/agent_listener/invoke_raw_method?method=preconnect`. Notice that a query
string with the `method` parameter is present. This is required, as the
value of `method` will be used to look up the handler when receiving
requests.
@param {function} handler A typical `(req, res) => {}` handler. For
convenience, `res` is extended with a `json({ payload, code = 200 })`
method for easily sending JSON responses. Also, `req` is extended with
a `body()` method that returns a promise which resolves to the string
data supplied via POST-like requests.