Use a different port for dev/prod environments
jeffposnick opened this issue · 1 comments
jeffposnick commented
As of #63 there's a different service worker generated based on whether you're in the 'dev' or 'prod' environments. When working on similar setups, I've found it useful to use a different port number for your server depending on the environment as well. That way your 'dev' SW registration will remain separate from your 'prod' SW registration, and you won't keep triggering the SW update flow every time you switch from 'dev' to 'prod'.
jeffposnick commented
And you might want to use process.env.PORT
for 'prod' and some arbitrary number for 'dev', since I know some hosting environment specifically require listening on process.env.PORT
.