Chrome Dev Summit is back! Visit goo.gle/cds2021 to secure your spot in workshops, office hours and learning lounges!

Class: RegExpRoute

Constructor

RegExpRoute

new RegExpRoute(regExp, handler, method)

If the regular expression contains capture groups, the captured values will be passed to the handler's params argument.

Parameter

regExp

RegExp

The regular expression to match against URLs.

handler

module:workbox-routing~handlerCallback

A callback function that returns a Promise resulting in a Response.

method

Optional

string

The HTTP method to match the Route against.

Extends
module:workbox-routing.Route

Method

setCatchHandler

setCatchHandler(handler)

Parameter

handler

A callback function that returns a Promise resolving to a Response

Inherited from
module:workbox-routing.Route#setCatchHandler