source: frontend/node_modules/workbox-routing/src/setDefaultHandler.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 919 bytes
Line 
1/*
2 Copyright 2019 Google LLC
3
4 Use of this source code is governed by an MIT-style
5 license that can be found in the LICENSE file or at
6 https://opensource.org/licenses/MIT.
7*/
8
9import {RouteHandler} from 'workbox-core/types.js';
10
11import {getOrCreateDefaultRouter} from './utils/getOrCreateDefaultRouter.js';
12
13import './_version.js';
14
15/**
16 * Define a default `handler` that's called when no routes explicitly
17 * match the incoming request.
18 *
19 * Without a default handler, unmatched requests will go against the
20 * network as if there were no service worker present.
21 *
22 * @param {workbox-routing~handlerCallback} handler A callback
23 * function that returns a Promise resulting in a Response.
24 *
25 * @memberof workbox-routing
26 */
27function setDefaultHandler(handler: RouteHandler): void {
28 const defaultRouter = getOrCreateDefaultRouter();
29 defaultRouter.setDefaultHandler(handler);
30}
31
32export {setDefaultHandler};
Note: See TracBrowser for help on using the repository browser.