ForgeTotal.js 5
en

Total.js 5

Configure the app with the config file

Total.js 5 · total5@0.0.19 configsettings Executed against Total.js 5

The config file in the root of the project holds one key : value setting per line. At runtime the values are available in the global CONF object. Values are strings unless you declare a type in brackets after the key: limit (number) : 10 or debug (boolean) : true.

config
name       : Forge demo
limit (number) : 10
debug (boolean) : true
controllers/settings.js
exports.install = function() {
	ROUTE('GET /settings/', settings);
};

function settings($) {
	$.json({ name: CONF.name, limit: CONF.limit, debug: CONF.debug });
}

In a view you can read the same values with @{'%name'}.