Deployment of Angular 7 PWA application in Tomcat Apache production server

落花浮王杯 提交于 2021-01-29 09:36:19

问题


I've created an Angular PWA application and built it by running: ng build --prod.

It has built the production ready application successfully.
I've ran the built application in local by running command: http-server -o, It was running as expected.

Problem:
When I've deployed in production's server tomcat apache webapp directory and ran it I am getting: Service worker is not registered or does not control the Start URL.

Service worker is not registering in my production environment.

Please Help me Thank you


回答1:


You need to have HTTPS connection to register a service worker. But still it works on localhost without HTTPS.

https://developers.google.com/web/fundamentals/primers/service-workers/#you_need_https



来源:https://stackoverflow.com/questions/56375511/deployment-of-angular-7-pwa-application-in-tomcat-apache-production-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!