Ghost/core/server/services/settings/index.js
2017-12-14 03:01:23 +01:00

20 lines
575 B
JavaScript

/**
* Settings Lib
* A collection of utilities for handling settings including a cache
*/
var SettingsModel = require('../../models/settings').Settings,
SettingsCache = require('./cache');
module.exports = {
init: function init() {
// Update the defaults
return SettingsModel.populateDefaults()
.then(function (settingsCollection) {
// Initialise the cache with the result
// This will bind to events for further updates
SettingsCache.init(settingsCollection);
});
}
};