Constructor

new NavigationRoute(input)

Constructor for NavigationRoute.

Parameter

input

Object

Extends
Route

Example

// Any navigation requests that match the whitelist (i.e. URLs whose path
// starts with /article/) will be handled with the cache entry for
// app-shell.html.
const route = new workbox.routing.NavigationRoute({
  whitelist: [new RegExp('^/article/')],
  handler: {handle: () => caches.match('app-shell.html')},
});

const router = new workbox.routing.Router();
router.registerRoute({route});