From 58d8b6fe364c81a3ba910b29560db09bf1da17fb Mon Sep 17 00:00:00 2001 From: CheddarCrisp Date: Thu, 6 Feb 2020 16:08:53 -0500 Subject: [PATCH] Properly set up default route --- src/sw.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/sw.js b/src/sw.js index 0a0b252..9797d74 100644 --- a/src/sw.js +++ b/src/sw.js @@ -1,4 +1,4 @@ -import {registerRoute} from 'workbox-routing'; +import {registerRoute,setDefaultHandler} from 'workbox-routing'; import {CacheFirst, StaleWhileRevalidate, NetworkFirst} from 'workbox-strategies'; import {CacheableResponsePlugin} from 'workbox-cacheable-response'; import {ExpirationPlugin} from 'workbox-expiration'; @@ -34,8 +34,5 @@ registerRoute( cacheName: 'static-resources', }) ); - -registerRoute( - '/', - new NetworkFirst() -) \ No newline at end of file + +setDefaultHandler(new NetworkFirst()); \ No newline at end of file