Setting up a Remote server prior to publishing
Check out this tutorial to learn how to set up a Remote server before publishing your i4scada Application template project.
With the i4scada App Template solution opened in Visual Studio, navigate to the _pageTemplates folder. There are two index templates available:
index-app.tpl - used when publishing the complete application
index-standalone.tpl - used when publishing the application in standalone mode, without Durandal
Depending on your publishing method, open the correct index template and 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 and proceed with publishing the application. Make sure to choose the correct publishing task inside the Task Runner.
Deploy the application to IIS and access it using a web browser. The application will now use the web services hosted on the specified remote server.
Note
If modifying the index-app.tpl, only publishing the app using the publish-app task will reflect the modification. The same goes for the standalone method.