【问题标题】:How to remove the sockjs-node error for a asp.net core angular application?如何删除 asp.net 核心角度应用程序的 sockjs-node 错误?
【发布时间】:2019-04-28 16:53:32
【问题描述】:
我有一个 asp.net core angular 应用程序。我删除了该应用程序中的 ClientApp 文件夹,并使用 ng new 命令创建了一个新的 Angular 8.1 beta 应用程序。应用程序可以运行,但是我在浏览器中看到很多net::ERR_SSL_PROTOCOL_ERROR。
我应该怎么做才能消除这些错误?
【问题讨论】:
标签:
angular
asp.net-core-2.0
sockjs
【解决方案1】:
我刚刚遇到了和你完全相同的问题。问题是发生更改时的实时重新加载。要修复此更新,请使用 ng serve 脚本并设置 public-host 选项。
我正在从 /app1 路由提供我的 Angular 应用程序,所以我的 ng 服务看起来像
ng serve --base-href=/app1/ --serve-path=/ --public-host=localhost:5001/app1