# Configurar a aplicação com o ficheiro config

> Guarde as definições num ficheiro config e leia-as através de CONF.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: pt
Content-SHA256: 0ed14e6f478e7d89413739936553673278156dd729d6fae050ce4fa62d874351
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

O ficheiro `config` na raiz do projeto tem uma definição `key : value` por linha. Em execução, os valores estão disponíveis no objeto global `CONF`. Os valores são strings, a menos que declare um tipo entre parênteses depois da chave: `limit (number) : 10` ou `debug (boolean) : true`.

```text config
name       : Forge demo
limit (number) : 10
debug (boolean) : true
```

```js controllers/settings.js
exports.install = function() {
	ROUTE('GET /settings/', settings);
};

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

Numa vista pode ler os mesmos valores com `@{'%name'}`.
