0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Moved emit-events mw into parent app

- Moved emit-events from shared to parent as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
This commit is contained in:
Hannah Wolfe 2020-04-21 18:36:42 +01:00
parent e53baac13d
commit 295eac6ea1
4 changed files with 2 additions and 5 deletions

View file

@ -25,7 +25,7 @@ module.exports = function setupParentApp(options = {}) {
parentApp.use(mw.logRequest);
// Register event emmiter on req/res to trigger cache invalidation webhook event
parentApp.use(shared.middlewares.emitEvents);
parentApp.use(mw.emitEvents);
// enabled gzip compression by default
if (config.get('compress') !== false) {

View file

@ -1,4 +1,5 @@
module.exports = {
emitEvents: require('./emit-events'),
logRequest: require('./log-request'),
requestId: require('./request-id')
};

View file

@ -57,9 +57,5 @@ module.exports = {
get updateUserLastSeen() {
return require('./update-user-last-seen');
},
get emitEvents() {
return require('./emit-events');
}
};