Skip to main content

Environment

You can define different environment variables depending on the environments you start your application in. These variables are replaced with their value at runtime. Typicall variables defined in environments are URLs for external third-party APIs (i.e. different environments could point towards the development and production API). Most of the time you will find an environment called default for production purposes and one called local for development on you local machine.

screenshot of an environment folder.

Example

Definition

Every JSON-file in the ./environment directory is interpreted as an evironment file. The file name can later be used to start the config with the respectiv environment variables.

\versions\v1\environment\test.json
{
"apiUrl": "https://staging.api.mobilitysuite.de",
"rootCategory": "rootCategoryStaging"
}

Usage

Having variables defined in at least one environment.json file you can reference these in your application files with $env([variableName]).

\versions\v1\client_template\detailPage.json
...
{
"type": "request",
"params": {
"url": "$env(apiUrl)$/api/productDetail/productForOption/{{prodId}}",
"method": "GET",
...
},
...
...