A rewrite of the Raspberry Pi Garage Door Opener using Flask
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
540 B

  1. // CREDITS: https://www.pwabuilder.com/serviceworker
  2. // File Created by [Check Commits for Name]
  3. // This is the service worker with the Cache-first network
  4. const CACHE = "pwabuilder-precache";
  5. importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');
  6. self.addEventListener("message", (event) => {
  7. if (event.data && event.data.type === "SKIP_WAITING") {
  8. self.skipWaiting();
  9. }
  10. });
  11. workbox.routing.registerRoute(
  12. new RegExp('/'),
  13. new workbox.strategies.CacheFirst({
  14. cacheName: CACHE
  15. })
  16. );