Setting up a Remote server after publishing
Open this article and follow the provided steps to learn how to set up a Remote server after publishing the i4scada App Template project.
Navigate to the folder where the i4scada App is hosted on the IIS. A common location is C:\inetpub\wwwroot\YourAppName.
Open the index.html in a text editor of your choice, using administrative privileges.
If the application folder is on a protected drive, such as the Windows system drive, the text editor must be opened as Administrator in order to be able to save any edits.
Search for the
//var remoteIISServer = "localhost";
line. It is located near the top of the body HTML tag, inside a script tag.... <body> <div id="applicationHost"> {% autoescape false %}{{ splashContents }}{% endautoescape %} </div> <script type="text/javascript" src="Scripts/vendor1.bundle.js?v={{appVersion}}"></script> <script type="text/javascript" src="Scripts/vendor2.bundle.js?v={{appVersion}}"></script> <script type="text/javascript" src="Scripts/vendor3.bundle.js?v={{appVersion}}"></script> <script type="text/javascript"> var urlPath = window.document.location.href; var remoteIISServer = window.document.location.hostname; //var remoteIISServer = "localhost"; ...
By default, the remoteIISServer variable is set to the local machine, assuming that the same machine running the application is also running the web services. To point the remoteIISServer variable to a remote server running the web services, un-comment the commented line and replace its default value with the name/IP of the remote server. Then comment the line above it, pointing to the default hostname.
<script type="text/javascript"> var urlPath = window.document.location.href; //var remoteIISServer = window.document.location.hostname; var remoteIISServer = "YourRemoteServerNameOrIP";
Save the modified index.html and open/reload the application in the web browser. The application will now use the web services hosted on the specified remote server.