This is a basic example of using the proposed URLPattern web platform feature to handle routing tasks that would otherwise require loading a dedicated routing library. (A polyfill is used in browers without built-in support.)
Routing is performed inside of the registered service worker's fetch event handler, with a few "fake" API, CDN, and page templating URLs supported.
You can view and remix this project on Glitch.
Go to page 1