Trying to find a solution, i found 4 solutions, but i would like to know which one is better / best practice. And why! :P
1. Using req.app.get()
// app.js
app.set('settings', { domain: 'http://www.example.org' });
// other file
console.log(req.app.get('settings'));
2. Using req.app.settings (similar to above)
// app.js
app.set('settings', { domain: 'http://www.example.org' });
// other file
console.log(req.app.settings.settings);
3. Exporting app object so i can access app.get() without req object
// app.js
app.set('settings', { domain: 'http://www.example.org' });
module.exports = app;
// other file
var app = require('../app');
console.log(app.get('settings'));
4. Using a global variable. Probably bad idea but... isn't "settings" a global thing anyway? (I can avoid reusing it so i dont get scope problems)
// app.js
settings = { domain: 'http://www.example.org' };
// other file
console.log(settings);