From 7ff9ddd190d6640b2fec2538140e89a286436e48 Mon Sep 17 00:00:00 2001 From: Roberto Alvarez Date: Wed, 23 Feb 2022 09:28:01 -0600 Subject: [PATCH] fix: add options scope config to debugging uncaught requests --- docs/recipes/debugging-uncaught-requests.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/recipes/debugging-uncaught-requests.mdx b/docs/recipes/debugging-uncaught-requests.mdx index 9af5f7e3..1d46762f 100644 --- a/docs/recipes/debugging-uncaught-requests.mdx +++ b/docs/recipes/debugging-uncaught-requests.mdx @@ -89,6 +89,19 @@ app.use((req, res, next) => { }) ``` +After setting the header on the server, initialize your worker with the corresponding scope by using the options object: + +```js focusedLines=8 +worker.start({ + serviceWorker: { + url: '/your/custom/path/mockServiceWorker.js', + options: { + scope: '/', + }, + }, +}); +``` + ## Run in debug mode - Applicable to: `setupServer`