小编k1d*_*l3r的帖子

.Net Core 2.1 - 在 javascript 文件中读取 appsettings.json

我在 .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)

javascript signalr asp.net-core-mvc .net-core asp.net-core

4
推荐指数
2
解决办法
9250
查看次数