Chrome Dev Summit 2020 is back & going virtual on December 9-10. Learn more

Class: Route

Constructor

Route

new Route(match, handler, method)

Constructor for Route class.

Parameter

match

module:workbox-routing~matchCallback

A callback function that determines whether the route matches a given fetch event by returning a non-falsy value.

handler

module:workbox-routing~handlerCallback

A callback function that returns a Promise resolving to a Response.

method

Optional

string

The HTTP method to match the Route against.