I'm trying to use Compound JS and want to load on startup some values from DB and store them in global variables shared across all sessions.
How can I do it?
One way would be to put them in the config/initializers
folder.
Example: /config/initializers/settings.js
module.exports = function (compound) {
compound.models.Setting.all(function (err, settings) {
compound.settings = settings;
});
};