【发布时间】:2019-04-03 09:14:17
【问题描述】:
我正在尝试在 angularJS 中实现 signalR, 我想将相对 url 传递给集线器连接,但它正在生成当前 url(我的 angular 应用程序在其上托管)
我的 API 基本网址:http://localhost:81/NrsService/api/TestSignal
我的 Angular 应用程序运行在
http://localhost:81
这是我的 signalR 设置:
$.connection.hub.url = "/NrsService/api/TestSignal";
//Getting the connection object
connection = $.hubConnection();
就像它在http://localhost:81/signalr/negotiate? 发送请求,但我希望它是http://localhost:81/NrsService/api/TestSignal/negotiate?
【问题讨论】:
-
您找到解决方案了吗?我有同样的问题..
标签: angularjs asp.net-web-api signalr signalr-hub