Simple Progressive Web App middleware for Express
/sw.js
/manifest.json
No config implemented
const pwa = require('./middleware/pwa');
this.server.use(pwa(this, this.config));
{
"pwa": {
"shortName": "Project",
"name": "DPDK Project",
"backgroundColor": "#000000",
"themeColor": "#000000"
}
}
To implement your own Service Worker implement the following function:
const NextBootstrap = require('@dpdk/bootstrap');
const bootstrap = new NextBootstrap(__dirname, process.cwd(), nextConfig);
bootstrap.customSw = (version, offlinePage, callback) => {
const sw = ''; // Implement custom Service Worker here
callback(sw);
};
bootstrap.init();
No links available
Last modified | Friday, April 30, 2021, 12:00:21 PM UTC |
Last author | Colin van Eenige |
Commit ID | 4c7a701 |