Our current approach for streaming apps involves compiling each web file (CSS, JS, HTML, PNG etc) as a streaming service, SAS 9 STP or Viya.
With Viya however we actually have the ability to load these files as files rather than services. This reduces complexity, aids debugging, and most importantly - means that we can retain a fixed URL when opening the homepage (rather than a temporary job UUID).
The following parts need to be changed:
Deploy Servicepack
This needs to be able to deploy non ".sas" files as native content using the files API
sasjs web
When compiling the clickme page, for Viya, we need to change the underlying urls to _file= rather than _program=. The default behaviour of redirecting the output via the /files/files/UUID/content endpoint can be prevented by adding the _debug=2 url parameter. This will serve the content through an iframe, preserving the URL. To fix the dimensions of the iframe, we will need to inject the following code in the HTML page:
At the end of the build.sas program, rather than directing users to the $url/SASJobExecution/?_program=/appLoc/services/clickme service, we should send them to $url/SASJobExecution/?_file=/appLoc/services/clickme&_debug=2
Our current approach for streaming apps involves compiling each web file (CSS, JS, HTML, PNG etc) as a streaming service, SAS 9 STP or Viya.
With Viya however we actually have the ability to load these files as files rather than services. This reduces complexity, aids debugging, and most importantly - means that we can retain a fixed URL when opening the homepage (rather than a temporary job UUID).
The following parts need to be changed:
Deploy Servicepack
This needs to be able to deploy non ".sas" files as native content using the files API
sasjs web
When compiling the clickme page, for Viya, we need to change the underlying urls to
_file=
rather than_program=
. The default behaviour of redirecting the output via the/files/files/UUID/content
endpoint can be prevented by adding the_debug=2
url parameter. This will serve the content through an iframe, preserving the URL. To fix the dimensions of the iframe, we will need to inject the following code in the HTML page:sasjs compile (build.sas program)
We need to add a macro to the precode (mv_createfile.sas) and invoke it (instead of mv_createwebservice.sas eg as follows:
%mv_createfile(path=$(appLoc)/services/web,name=somefile.js,inref=sasjs)
Log message
At the end of the build.sas program, rather than directing users to the
$url/SASJobExecution/?_program=/appLoc/services/clickme
service, we should send them to$url/SASJobExecution/?_file=/appLoc/services/clickme&_debug=2