DPDK Architecture  ->  Bootstrap (v3.0.5)

PWA
>= v1.28.0

Simple Progressive Web App middleware for Express

Features

  • Provides a default Service Worker at: /sw.js
  • Provides a manifest at: /manifest.json
  • Includes the default function with configuration from the application config

Bootstrap

Config

No config implemented

Implementation

const pwa = require('./middleware/pwa');

this.server.use(pwa(this, this.config));

Usage

Config

{
  "pwa": {
    "shortName": "Project",
    "name": "DPDK Project",
    "backgroundColor": "#000000",
    "themeColor": "#000000"
  }
}

Custom Service Worker

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();

Links

No links available

Last modifiedFriday, April 30, 2021, 12:00:21 PM UTC
Last authorColin van Eenige
Commit ID4c7a701