workbox.routing. RegExpRoute
RegExpRoute makes it easy to create a regular expression based Route.
For same-origin requests the RegExp only needs to match part of the URL. For requests against third-party servers, you must define a RegExp that matches the start of the URL.
Constructor
RegExpRoute
new RegExpRoute(regExp, handler, method)
If the regulard expression contains
capture groups, th ecaptured values will be passed to the
handler's params
argument.
Parameter |
|
---|---|
regExp |
RegExp The regular expression to match against URLs. |
handler |
workbox.routing.Route~handlerCallback A callback function that returns a Promise resulting in a Response. |
method |
Optional string The HTTP method to match the Route against. |
- Extends
- workbox.routing.Route