This repository has been archived by the owner on Feb 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aravind V Nair <[email protected]>
- Loading branch information
1 parent
531ff49
commit 8618246
Showing
7 changed files
with
86 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# Prerequisites: | ||
# Prerequisites | ||
|
||
* npm | ||
* Node.js | ||
* Firebase | ||
- npm | ||
- Node.js | ||
- Firebase | ||
|
||
Check [here](https://github.com/aravindvnair99/FACE-Amrita-Bengaluru/network/dependencies) for the remaining prerequisites. | ||
|
||
Check [here](https://github.com/aravindvnair99/FACE-Amrita-Bengaluru/blob/master/functions/package.json) for viewing the package.json file. | ||
|
||
# Recommendations: | ||
# Recommendations | ||
|
||
* Visual Studio Code as text editor. | ||
- Visual Studio Code as text editor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,44 @@ | ||
//This is the "Offline page" service worker | ||
|
||
//Install stage sets up the offline page in the cache and opens a new cache | ||
self.addEventListener('install', function(event) { | ||
var offlinePage = new Request('offline.html'); | ||
event.waitUntil( | ||
fetch(offlinePage).then(function(response) { | ||
return caches.open('pwabuilder-offline').then(function(cache) { | ||
console.log('[PWA Builder] Cached offline page during Install'+ response.url); | ||
return cache.put(offlinePage, response); | ||
}); | ||
})); | ||
self.addEventListener("install", function (event) { | ||
var offlinePage = new Request("offline.html"); | ||
event.waitUntil( | ||
fetch(offlinePage).then(function (response) { | ||
return caches.open("pwabuilder-offline").then(function (cache) { | ||
console.log( | ||
"[PWA Builder] Cached offline page during Install" + | ||
response.url | ||
); | ||
return cache.put(offlinePage, response); | ||
}); | ||
}) | ||
); | ||
}); | ||
|
||
//If any fetch fails, it will show the offline page. | ||
//Maybe this should be limited to HTML documents? | ||
self.addEventListener('fetch', function(event) { | ||
event.respondWith( | ||
fetch(event.request).catch(function(error) { | ||
console.error( '[PWA Builder] Network request Failed. Serving offline page ' + error ); | ||
return caches.open('pwabuilder-offline').then(function(cache) { | ||
return cache.match('offline.html'); | ||
}); | ||
} | ||
)); | ||
self.addEventListener("fetch", function (event) { | ||
event.respondWith( | ||
fetch(event.request).catch(function (error) { | ||
console.error( | ||
"[PWA Builder] Network request Failed. Serving offline page " + | ||
error | ||
); | ||
return caches.open("pwabuilder-offline").then(function (cache) { | ||
return cache.match("offline.html"); | ||
}); | ||
}) | ||
); | ||
}); | ||
|
||
//This is a event that can be fired from your page to tell the SW to update the offline page | ||
self.addEventListener('refreshOffline', function(response) { | ||
return caches.open('pwabuilder-offline').then(function(cache) { | ||
console.log('[PWA Builder] Offline page updated from refreshOffline event: '+ response.url); | ||
return cache.put(offlinePage, response); | ||
}); | ||
self.addEventListener("refreshOffline", function (response) { | ||
return caches.open("pwabuilder-offline").then(function (cache) { | ||
console.log( | ||
"[PWA Builder] Offline page updated from refreshOffline event: " + | ||
response.url | ||
); | ||
return cache.put(offlinePage, response); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,4 +168,4 @@ | |
<priority>0.80</priority> | ||
</url> | ||
|
||
</urlset> | ||
</urlset> |