Support server-side rendering with shell URL rewriting
We're working on a large UK publisher website and in the prototype stage of a PWA/AMP frontend.
For browsers that don't support service workers the user is currently served the AMP page but we'd like to rewrite to the PWA version using Shell URL Rewriting (https://www.ampproject.org/docs/reference/components/amp-install-serviceworker#shell-url-rewrite).
Currently all of the routing is done on the server. This request is to add support for server-side rendering to Shell URL rewriting.
Heya!
Super great to hear about your PWAMP efforts :)
I'm not sure I fully understand your request. The way shell URL rewriting works is that on an AMP page with <amp-install-serviceworker>, you can say "if support for Service Worker is not detected client-side, please rewrite all links on the page to go to somelegacyurl.mydomain.com/*". This is done automagically by AMP (based on your configuration), and doesn't require any additional routing on your part.
The only thing you need to do is to have a dedicated URL for your PWA that you can redirect to.
Or did I misunderstand?
Closing with https://github.com/ampproject/amphtml/issues/6853#issuecomment-270169312.