0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00
ghost/core/server/services/route-settings/index.js
Naz 1c8c55992a Simplified route settings module api
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- Made clear distinction around the methods that are exposed for the API use and for the internal use. Same pattern can be found in themese's and redirects module APIs
2021-09-28 09:47:42 +02:00

23 lines
742 B
JavaScript

const routeSettings = require('./route-settings');
const SettingsLoader = require('./loader');
const ensureSettingsFile = require('./ensure-settings');
module.exports = {
init: async () => {
// Make sure that supported settings files are available
// inside of the `content/setting` directory
return ensureSettingsFile('routes.yaml');
},
loadRouteSettingsSync: SettingsLoader.loadSettingsSync,
loadRouteSettings: SettingsLoader.loadSettings,
getDefaultHash: routeSettings.getDefaultHash,
/**
* Methods used in the API
*/
api: {
setFromFilePath: routeSettings.setFromFilePath,
get: routeSettings.get,
getCurrentHash: routeSettings.getCurrentHash
}
};