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
This commit is contained in:
Naz 2021-10-13 15:39:43 +02:00 committed by naz
parent dc4694d8d3
commit 0a9837ebcf

View File

@ -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;