route(message, cb) {
    debug("Routing HTTP message: %a", message);

    if (!has(this.routes, message.method)) {
      this.routeUnhandledHttpMethod(message, cb);
      return;
    }

    let routeHandler;

    try {
      routeHandler = this.routes[message.method].getHandler(message);

      // Set Headers if not present
      routeHandler.request.response.setHeaders(this.defaultHeaders, true);

      applyACAOHeader(message, routeHandler.request);

      if (routeHandler.handler === null) {
        throw kerror.get("url_not_found", routeHandler.url);
      }

      routeHandler.invokeHandler(cb);
    } catch (err) {
      let request;
      if (!routeHandler || !routeHandler._request) {
        request = new Request({ requestId: message.requestId }, {});
        // Set Headers if not present
        request.response.setHeaders(this.defaultHeaders, true);

        applyACAOHeader(message, request);
      } else {
        request = routeHandler.request;
      }

      const e =
        err instanceof KuzzleError
          ? err
          : kerror.getFrom(err, "unexpected_error", err.message);

      replyWithError(cb, request, e);
    }
  }
Route an incoming HTTP message to the right handler

@param {HttpMessage} message - Parsed HTTP message
@param {function} cb