angular / mobile-toolkit

Tools for building progressive web apps with Angular
MIT License
1.34k stars 175 forks source link

"routing" not working on deployed Azure #146

Closed bob-lee closed 7 years ago

bob-lee commented 7 years ago

Hi, I needs some help on using @angular/service-worker:

my website is static and shows some images, it seems working well on localhost, when reloading the page on offline, the page is served from ServiceWorker ok but after deployed on Azure here, reloading ".../home" page shows "This site can't be reached" message. it works only if specific address is provided like ".../index.html". My ngsw.mainifest.json looks like: { "routing": { "index": "/index.html", "routes": { "/": { "prefix": false }, "/home": { "prefix": false } } }, "external": { "urls": [ { "url": "https://fonts.googleapis.com/css?family=Quicksand|Tangerine" } ] } }

webmaxru commented 7 years ago

Hi! I see only auto-generated entries in ngsw-manifest.json: https://joanne-lee.azurewebsites.net/ngsw-manifest.json

Are you sure you named/located your custom manifest file properly so it will be merged to the auto-generated one?

Pro tip: you can check NGSW log by opening the URL: https://joanne-lee.azurewebsites.net/ngsw.log

bob-lee commented 7 years ago

Hi Maxim, apparently merging is not happening for some reason. Can you please check my source here? ng build --prod doesn't seems to make any change on autogenerated /dist/ngsw.manifest.json but when testing on localhost by node server.js, custom manifest on /ngsw.manifest.json somehow seems to take effect.

webmaxru commented 7 years ago

Wrong filename. Should be ngsw-manifest.json

bob-lee commented 7 years ago

Perfect! Thanks Maxim, looking forward to see documents update soon ;)

webmaxru commented 7 years ago

You are welcome! Please share your further experience with NGSW, it's important for the team to get the feedback from real-life usecases :)