I’d like to serve a service worker (sw.js). I can just put it in
/public but if I do that it doesn’t serve the right content type header.
How can I set the right content type header for assets in
/public? This knowledge would be useful for more than just this - but it would solve this problem too.
Even better - how can I use the build system, to serve a built bundle for the sw.js file? A pointer in the right location would be lovely. I guess I’d need to register a new type of end point (like server and client and maybe cordova). Is this even possible?
To get the right content header, I thought to use
WebApp.connectHandlers.use, but I’m not sure if that will block access to the file (I’ll try it - but I thought I’d ask anyway)