noop-service-worker-middleware
Returns Express middleware that serves a service worker that resets any previously set service worker configuration. Useful for development.
Last updated 2 years ago by evilebottnawi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install noop-service-worker-middleware 
SYNC missed versions from official npm registry.

noop-service-worker-middleware

NPM version Travis Build Status dependencies Status devDependencies Status Greenkeeper badge

Returns Express middleware that serves a service worker that resets any previously set service worker configuration. Useful for development.

Installation

npm i -D noop-service-worker-middleware

API

const noopServiceWorkerMiddleware = require("noop-service-worker-middleware");

noopServiceWorkerMiddleware(path)

Returns Express middleware that serves a service worker that resets any previously set service worker configuration.

Options

path

Filename of service worker.

app.use(noopServiceWorkerMiddleware("/custom-service-worker.js"));

Examples

Simple

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!");
});

Webpack Dev Server

const noopServiceWorkerMiddleware = require("noop-service-worker-middleware");

module.exports = {
  // ...
  devServer: {
    before(app, server) {
      app.use(noopServiceWorkerMiddleware());
    }
    // ...
  }
  // ...
};

Thanks

Changelog

Changelog

License

MIT

Current Tags

  • 3.0.0                                ...           latest (2 years ago)

3 Versions

  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |