-
Notifications
You must be signed in to change notification settings - Fork 2
appenv
The restaf-server supports a special route /{APPNAME}/appenv which returns two objects
- LOGONPAYLOAD
- APPENV
In your html include the following script tag
<script src="/{yourappname}/appenv></script>
Example:
<script src="/viyaapp/appenv><script>
This will result in two js objects named LOGONPAYLOAD and APPENV to be populated.
This object has information that are useful for connecting to SAS Viya.
let LOGONPAYLOAD = {
authType : <value of AUTHFLOW>
redirect : <here for backward compatability>
host : <value of VIYA_SERVER>,
clientID : <here for backward compatability>,
appName : <value of APPNAME>,
keepAlive: <null or url for the /{APPNAME}/KEEPALIVE route>
};
1 host - useful for making REST calls to SAS Viya and as parameter to VA-SDK. Use this (LOGONPAYLOAD.host) to avoid hard-coding the viya server in the application
2 appName - this is the application name set by the APPNAME value in the env file
3 keepAlive - it is either null or the url to the keepAlive route in the app server
Note for restaf users: Pass LOGONPAYLOAD to store.logon
This object is whatever was returned from js function set as the appenv parameter when starting the application server. This is convenient way to configure your application for different scenarios.