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
// Session Setup | |
import sessionFileStore from 'session-file-store'; | |
import expressSession from 'express-session'; | |
declare module 'express-session' { | |
interface SessionData { | |
[key: string]: any | |
} | |
} | |
const fileStore = sessionFileStore(expressSession) | |
app.use(expressSession({ |
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
// Show notification if some data pushed to the service worker | |
self.addEventListener('push', event => { | |
// Get the data from the push message | |
const notification = event.data.json(); | |
// Show the notification | |
event.waitUntil(self.registration.showNotification(notification.title, { | |
body: notification.body, | |
icon: 'icon.png', | |
data: { |