admin管理员组文章数量:1287137
in a WebApp project, I need the static files in App.razor, including the Blazor startup section:
<link href=".css" rel="stylesheet" />
<script src="_framework/blazor.web.js" autostart="false"></script>
<script>
Blazor.start({
webAssembly: {
loadBootResource: function (type, name, defaultUri, integrity) {
console.log('Loading:', type, name, defaultUri, integrity);
switch (type) {
case 'dotnetjs':
case 'dotnetwasm':
case 'timezonedata':
case 'assembly':
return `/${name}`;
}
}
}
});
</script>
I want the CDN URL to be configurable via an environment variable in appsettings.json for production purposes because we have QA, PRE, and PROD environments. Additionally, it should be compatible with debugging.
What is the correct way to configure the download of Blazor static files from a CDN in a parameterizable way, considering that the .wasm files are different in each environment due to different application versions and should point to a different container in the CDN?
How can this be done?
Thanks
Configure in the App.razor
file of the web app project so that the CDN path varies by environment based on an environment variable in appsettings.json
or by directly retrieving the path value from a variable in that file.
本文标签:
版权声明:本文标题:asp.net core - Static files and Blazor files download in start script section with CDN Url as parameter - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741262112a2367819.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论