Returns Express middleware that serves a service worker that resets any previously set service worker configuration. Useful for development.
npm i -D noop-service-worker-middleware
const noopServiceWorkerMiddleware = require("noop-service-worker-middleware");
Returns Express middleware that serves a service worker that resets any previously set service worker configuration.
Filename of service worker.
app.use(noopServiceWorkerMiddleware("/custom-service-worker.js"));
const express = require("express");
const noopServiceWorkerMiddleware = require("noop-service-worker-middleware");
const app = express();
app.use(noopServiceWorkerMiddleware());
app.get("/", (req, res) => {
res.send("hello, world!");
});
const noopServiceWorkerMiddleware = require("noop-service-worker-middleware");
module.exports = {
// ...
devServer: {
before(app, server) {
app.use(noopServiceWorkerMiddleware());
}
// ...
}
// ...
};
- create-react-app - inspiration.