1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00

add app hooks

This commit is contained in:
sveisvei 2016-12-28 21:04:26 +01:00
parent dfa490affb
commit ed5203d445

View File

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