acceptsRequest method

bool acceptsRequest(
  1. APIRequest apiRequest
)

Returns true if apiRequest is an accepted route/call.

Implementation

bool acceptsRequest(APIRequest apiRequest) {
  var module = getModuleByRequest(apiRequest);
  if (module == null) {
    var def = defaultModuleName;
    if (def != null) {
      module = _modules![def];
    }
  }

  if (module == null) {
    if (apiRequest.pathPartAt(0) == authenticationRoute ||
        apiRequest.pathPartAt(1) == authenticationRoute) {
      return true;
    }

    return false;
  }

  return module.acceptsRequest(apiRequest);
}