In order to run service-worker code on the server, we'll need to provide the interfaces available in the browser:
- Registration to a scope. This introduces a very basic routing scope, but most finer-grained routing is likely to happen inside the service worker.
- fetch, possibly via https://github.com/matthew-andrews/isomorphic-fetch
- This also provides a basic Response implementation, wrapping the node HTTP response object.
- Request wrapper for Node's IncomingMessage.
- Cache. On the server, we might want to use this for in-process caching of frequently-used fragments.