Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
const buildPaths = require('mwp-config').paths;
const path = require('path');
/*
* The service worker plugin will register a root-level route for serving the
* service worker script file.
*
* Disk location of the script file is determined by builder CLI config import.
*/
export function register(server: Object, options: ?Object) {
/*
* Route for service worker script at top-level path. Depends on `Inert`
* `path` must match client `serviceWorker.register` call - MWP provides this
* in the `` component
*/
server.route({
method: 'GET',