mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
ba964c549f
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings - Frontend is not meant to know about the underlying source of the "routes" configuration, so any reads/edits/validations are being moved into a backend service. This should also simplify the coupling of the backend with the frontend where the latter will get a JSON blob with all needed configuration during the boot - Nother problem the "get" method had was hiding an underlying function it was doing - reading the file from the filesystem SYNCRONOUSLY. It might be a thing we need to do during the "web" app initialization, but there's no clear need to do this in a sync fassion during the bootup for example. Also having a more explicit name should help :)
10 lines
384 B
JavaScript
10 lines
384 B
JavaScript
const debug = require('@tryghost/debug')('routing');
|
|
const routing = require('../../../frontend/services/routing');
|
|
const routeSettings = require('../../services/route-settings');
|
|
|
|
module.exports = function siteRoutes(options = {}) {
|
|
debug('site Routes', options);
|
|
options.routerSettings = routeSettings.loadRouteSettingsSync();
|
|
return routing.bootstrap.init(options);
|
|
};
|