Crypto Middleware
    Preparing search index...

    Function matchRoute

    • Match a request path against a list of glob-like route patterns.

      Supports:

      • Exact matches: /api/data
      • Wildcards: /api/* (matches one segment)
      • Globstar: /api/** (matches any number of segments)

      Parameters

      • path: string

        The request path.

      • routes: string[]

        Array of route patterns.

      Returns boolean

      true if the path matches any pattern.

      matchRoute("/api/users/42", ["/api/**"]); // true
      matchRoute("/health", ["/api/*"]); // false