Intercepting and Changing API Endpoint Roots in a Service Worker

This is one of those snippets that is cheeky-useful when I&rsquo;m in a pinch to test something but I don&rsquo;t have the code base. Well, or I just don&rsquo;t want to go through the steps of pulling the codebase, dealing with dependency hell, and then running a build that makes me question why people still use frameworks. But I digress. Sometimes, I need to swap the root of an API to point…