gpt4 book ai didi

angular - 在 Tomcat Apache 生产服务器中部署 Angular 7 PWA 应用程序

转载 作者:行者123 更新时间:2023-11-28 23:12:12 33 4
gpt4 key购买 nike

我创建了一个 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 连接才能注册服务 worker 。但它仍然可以在没有 HTTPS 的本地主机上运行。

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

关于angular - 在 Tomcat Apache 生产服务器中部署 Angular 7 PWA 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56375511/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com