mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
bd597db829
- This is part of the quest to separate the frontend and server & get rid of all the places where there are cross-requires - At the moment the settings cache is one big shared cache used by the frontend and server liberally - This change doesn't really solve the fundamental problems, as we still depend on events, and requires from inside frontend - However it allows us to control the misuse slightly better by getting rid of restricted requires and turning on that eslint ruleset
18 lines
573 B
JavaScript
18 lines
573 B
JavaScript
const settingsCache = require('../../../shared/settings-cache');
|
|
const urlUtils = require('../../../shared/url-utils');
|
|
|
|
module.exports = {
|
|
docName: 'settings',
|
|
|
|
browse: {
|
|
permissions: true,
|
|
query() {
|
|
// @TODO: decouple settings cache from API knowledge
|
|
// The controller fetches models (or cached models) and the API frame for the target API version formats the response.
|
|
return Object.assign({}, settingsCache.getPublic(), {
|
|
url: urlUtils.urlFor('home', true)
|
|
});
|
|
}
|
|
}
|
|
};
|