From 0a9837ebcfe33e5c57c27b30bb61d03988ccbea8 Mon Sep 17 00:00:00 2001 From: Naz Date: Wed, 13 Oct 2021 15:39:43 +0200 Subject: [PATCH] Made bootstrap module's API slightly more readable refs https://linear.app/tryghost/issue/CORE-103/decouple-internal-frontend-code-from-url-module - It was hard to see straight away what methods the module exposes --- core/frontend/services/routing/bootstrap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/frontend/services/routing/bootstrap.js b/core/frontend/services/routing/bootstrap.js index 76dbec3bfc..d78166824b 100644 --- a/core/frontend/services/routing/bootstrap.js +++ b/core/frontend/services/routing/bootstrap.js @@ -29,7 +29,7 @@ let siteRouter; * @param {Object} options * @returns {ExpressRouter} */ -module.exports.init = ({start = false, routerSettings, apiVersion}) => { +const init = ({start = false, routerSettings, apiVersion}) => { debug('bootstrap init', start, apiVersion, routerSettings); registry.resetAllRouters(); @@ -64,7 +64,7 @@ module.exports.init = ({start = false, routerSettings, apiVersion}) => { * @param {string} apiVersion * @param {object} routerSettings */ -module.exports.start = (apiVersion, routerSettings) => { +const start = (apiVersion, routerSettings) => { debug('bootstrap start', apiVersion, routerSettings); const RESOURCE_CONFIG = require(`./config/${apiVersion}`); @@ -112,3 +112,6 @@ module.exports.start = (apiVersion, routerSettings) => { debug('Routes:', registry.getAllRoutes()); }; + +module.exports.init = init; +module.exports.start = start;