在 Tomcat Apache 生产服务器中部署 Angular 7 个 PWA 应用程序
Deployment of Angular 7 PWA application in Tomcat Apache production server
我创建了一个 Angular PWA 应用程序并由 运行 构建:ng build --prod
。
已成功构建生产就绪应用程序。
我已经 运行 通过 运行 命令在本地构建了应用程序:http-server -o
,正如预期的那样 运行。
问题:
当我在生产服务器 tomcat apache webapp 目录和 运行 中部署时,我得到:Service worker is not registered or does not control the Start URL
.
Service Worker 没有在我的生产环境中注册。
请帮助我谢谢
您需要有 HTTPS 连接才能注册服务工作者。但它仍然可以在没有 HTTPS 的本地主机上运行。
https://developers.google.com/web/fundamentals/primers/service-workers/#you_need_https
我创建了一个 Angular PWA 应用程序并由 运行 构建:ng build --prod
。
已成功构建生产就绪应用程序。
我已经 运行 通过 运行 命令在本地构建了应用程序:http-server -o
,正如预期的那样 运行。
问题:
当我在生产服务器 tomcat apache webapp 目录和 运行 中部署时,我得到:Service worker is not registered or does not control the Start URL
.
Service Worker 没有在我的生产环境中注册。
请帮助我谢谢
您需要有 HTTPS 连接才能注册服务工作者。但它仍然可以在没有 HTTPS 的本地主机上运行。
https://developers.google.com/web/fundamentals/primers/service-workers/#you_need_https