mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
0bf1542bc6
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.
19 lines
549 B
JavaScript
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);
|
|
});
|
|
}
|
|
};
|