I have a Asp.Net Core App. It uses ReactJS. In ./ClientApp/public I have a JS named configuration.js which contains:
var configs = {
"apiUrl": "https://localhost:44356"
}
... then in index.html in the body section:
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script src="configuration.js"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
... (I import this in webpack.config.js) so now react can use the Config.apiUrl. I would like to add a version variable in configuration.js. And read the .NET assembly version in javascript with something like DotNet.invokeMethod
from Call .NET methods from JavaScript functions in ASP.NET Core Blazor. Any help would be appreciated.