Config

This document describes the Config object in the JavaScript environment for app serivices.

Table of content

Object Config
Functions onchanged
save

Examples Reading config values
Changing config values
Get notified about config changes

Config

The config object contains the current values of all config items, as defined in the config.json.
onchanged
Registers a callback function that is invoked when the config has changed.

Parameters

function callback()Called whenever the config has changed.

Return value

ConfigA reference to the object itself. Useful for method chaining.
save
Writes the current config to the database.

Return value

ConfigA reference to the object itself. Useful for method chaining.

Examples

Reading config values

var token = Config.token;

Changing config values

Config.token = "xxxx";
Config.save();

Get notified about config changes

Config.onchanged(function() {
    // config has changed, read new values
});