web.dev LIVE has kicked off! Join us now for our digital event from June 30th to July 2nd at web.dev/live

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.