io.Connect Desktop uses application, layout, system and other configurations defined on the local machine, but can also be reconfigured to fetch them from a REST service.
This example project shows how to run a Node.js REST service that provides configuration stores for io.Connect Desktop.
To start:
# install the dependencies
$ npm i
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
This will start the service on port 8004 (by default). You can override the port by setting the SERVER_PORT
environment variable, as described later in the document.
Once the server is running, you can:
- view the Swagger UI by opening http://localhost:8004/api
- view the Swagger definition by opening http://localhost:8004/api-json or http://localhost:8004/api-yaml
To enable fetching configuration definitions from the REST service, you need to edit your local configuration files located in the %LOCALAPPDATA%\interop.io\io.Connect Desktop\Desktop\config
folder.
To enable fetching application configurations from the REST store, find the "appStores"
top-level key in the system.json
file and add a new entry (or replace existing entries) with the following configuration:
{
"appStores": [
{
"type": "rest",
"details": {
"url": "http://localhost:8004/apps/"
}
}
]
}
To enable fetching layouts from the REST store, find the "layouts"
top-level key in the system.json
file and edit the "store"
property - change the "type"
to "rest"
and assign the URL of the service to the "restURL"
:
{
"layouts": {
"store": {
"type": "rest",
"restURL": "http://localhost:8004/"
}
}
}
To enable reading and storing application preference from the REST store, find the "applicationPreferences"
top-level key in the system.json
file and edit the "store"
property - change the "type"
to "rest"
and assign the URL of the service to the "restURL"
:
{
"applicationPreferences": {
"store": {
"type": "rest",
"restURL": "http://localhost:8004/prefs"
}
}
}
To enable io.Connect Desktop to fetch system configurations from a remote location, use the "remoteConfig" top-level key of the gilding.json
configuration file:
{
"remoteConfig": {
"enabled": true,
"url": "http://localhost:8004/configs",
"wipeFolder": true
}
}
- SERVER_PORT - The port on which the REST service will run. Defaults to 8004
- APPS_FOLDER - Specifies the directory containing application definitions in JSON format. By default, it points to the
configuration\apps
folder, but the environment variableAPPS_FOLDER
can be used to override * this setting. - LAYOUTS_FOLDER - Specifies the directory for reading and storing layout definitions. By default, this is set to the
configuration\layouts
folder, but the environment variableLAYOUTS_FOLDER
can be used to override this setting. - PREFS_FOLDER - Specifies the directory used for reading and storing application preferences. By default, it points to the
configuration\prefs
folder, but the environment variablePREFS_FOLDER
can be used to override this setting. - CONFIGS_FOLDER - Specifies the directory for storing system configurations. By default, it points to the
configuration\configs
folder, but the environment variableCONFIGS_FOLDER
can be used to override this setting.