matches method

bool matches(
  1. HttpMethod method,
  2. String path
)

Check if this route matches the given method and path

Implementation

bool matches(HttpMethod method, String path) {
  if (this.method != method) return false;

  if (pathPattern != null) {
    return pathPattern!.hasMatch(path);
  }

  return this.path == path;
}