sys.app
sys.app
This package encompasses methods for retrieving information about the app, such as its name, URL, current environment, and more.
getLabel()
Returns the label of the app currently in execution.
Returns
string
- The label of the app.
Samples
// logs the label of the app
log('app: '+sys.app.getLabel());
getName()
Returns the name of the app currently in execution.
Returns
string
- The name of the app.
Samples
// logs the name of the app
log('app: '+sys.app.getName());
getEnv()
Returns the name of the environment in execution. It could be prod
or dev
.
Returns
string
- The label of environment in execution.
Samples
// logs the name of the environment
log('env: '+sys.app.getEnv());
getUrl()
Returns the URL of the app currently in execution. This URL might resemble something like https://yourapp.slingrs.io/dev/runtime
or https://yourapp.slingrs.io/prod/runtime
.
Returns
string
- The URL of the app.
Samples
// logs the URL of the app
log('app url: '+sys.app.getUrl());
getVersion()
Returns the version of app in execution. It is a timestamp.
Returns
string
- The version of the app.
Samples
// logs the version of the app
log('app version: '+sys.app.getVersion());
getDefaultLanguage()
Return the language code of the default language used in the app.
Returns
string
- Language code used in the app
Samples
// logs the default language of the app
log('app language: ' + sys.app.getDefaultLanguage());
getDefaultTimezone()
Return the id and label of the default timezone used in the app.
Returns
string
- ID and label of the default timezone used in the app.
Samples
// logs the default timezone of the app
log('app timezone: ' + JSON.stringify(sys.app.getDefaultTimezone()));