Search code examples
angularapachetomcatprogressive-web-appsangular-pwa

Deployment of Angular 7 PWA application in Tomcat Apache production server


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


Solution

  • 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