我在 .net Core 2.1 中有一个使用 signalR 的 Web 应用程序。我需要将 HubUrl 传递到自定义 javascript 文件中。这在 .net Core 中可能吗?
js代码示例:
const connection = new signalR.HubConnectionBuilder()
.withUrl('http://localhost:5000/hub') //Here I need to read appSettings.json to get value from there
.configureLogging(signalR.LogLevel.Information)
.build();
Run Code Online (Sandbox Code Playgroud)