diff --git a/lib/app.js b/lib/app.js index afc4dc31fb..a78b61f0d7 100644 --- a/lib/app.js +++ b/lib/app.js @@ -23,6 +23,11 @@ module.exports = function (config) { app.set('trust proxy'); app.set('port', config.port); app.locals.baseUriPath = baseUriPath; + + if (typeof config.preHook === 'function') { + config.preHook(app); + } + app.use(cookieParser()); if (publicFolder) { @@ -49,6 +54,10 @@ module.exports = function (config) { })); } + if (typeof config.preRouterHook === 'function') { + config.preRouterHook(app); + } + // Setup API routes const apiRouter = express.Router(); // eslint-disable-line new-cap routes.createAPI(apiRouter, config);