ForgeTotal.js 5
it

Total.js 5

Configurare l'app con il file config

Total.js 5 · total5@0.0.19 configsettings Eseguita con Total.js 5

Il file config nella radice del progetto contiene un'impostazione key : value per riga. In esecuzione i valori sono disponibili nell'oggetto globale CONF. I valori sono stringhe a meno che tu non dichiari un tipo tra parentesi dopo la chiave: limit (number) : 10 o 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 una vista puoi leggere gli stessi valori con @{'%name'}.