问题
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