Ghost/core/server/services/settings/index.js
Naz Gargol 0bf1542bc6
Extracted settings service part manipulating routes.yaml (#10800)
refs #10790
refs #9528

- The settings service was designed to handle more settings then just routing, but till this day there wasn't anything else added. As routes.yaml is only being used by frontend router so conceptually it fits better to have this code in frontend, so that it doesn't have to reach out to server
- The code left in server settings is the one that interacts with the database `settings` table and only partially provides information to frontend. That part is known as 'settings cache' and will be accessed through API controllers.
2019-06-25 18:33:56 +02:00

19 lines
549 B
JavaScript

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