From b2a8165d01cdbc26c93859380802e2c30c1b4257 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Sun, 15 Apr 2018 23:48:48 +0200 Subject: [PATCH] Consistent event names no issue - rename event to `server.stop` - rename event to `server.start` - we are using the dot notation --- core/server/ghost-server.js | 4 ++-- core/server/services/themes/index.js | 2 +- core/server/services/url/UrlService.js | 2 +- core/test/utils/index.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/server/ghost-server.js b/core/server/ghost-server.js index b68fb4e2a58b..61a93df9c68a 100644 --- a/core/server/ghost-server.js +++ b/core/server/ghost-server.js @@ -94,7 +94,7 @@ GhostServer.prototype.start = function (externalApp) { self.httpServer.on('connection', self.connection.bind(self)); self.httpServer.on('listening', function () { debug('...Started'); - common.events.emit('server:start'); + common.events.emit('server.start'); self.logStartMessages(); resolve(self); }); @@ -115,7 +115,7 @@ GhostServer.prototype.stop = function () { resolve(self); } else { self.httpServer.close(function () { - common.events.emit('server:stop'); + common.events.emit('server.stop'); self.httpServer = null; self.logShutdownMessages(); resolve(self); diff --git a/core/server/services/themes/index.js b/core/server/services/themes/index.js index 09a9c15a4a8d..4c9c9b578e8f 100644 --- a/core/server/services/themes/index.js +++ b/core/server/services/themes/index.js @@ -19,7 +19,7 @@ module.exports = { debug('init themes', activeThemeName); // Register a listener for server-start to load all themes - common.events.on('server:start', function readAllThemesOnServerStart() { + common.events.on('server.start', function readAllThemesOnServerStart() { themeLoader.loadAllThemes(); }); diff --git a/core/server/services/url/UrlService.js b/core/server/services/url/UrlService.js index 7233804ee39d..f508f887413d 100644 --- a/core/server/services/url/UrlService.js +++ b/core/server/services/url/UrlService.js @@ -44,7 +44,7 @@ class UrlService { UrlService.cacheRoute('/subscribe/', {}); // Register a listener for server-start to load all the known urls - common.events.on('server:start', (() => { + common.events.on('server.start', (() => { debug('URL service, loading all URLS'); this.loadResourceUrls(); })); diff --git a/core/test/utils/index.js b/core/test/utils/index.js index 30120da562e2..4cb7cb7f9553 100644 --- a/core/test/utils/index.js +++ b/core/test/utils/index.js @@ -933,7 +933,7 @@ startGhost = function startGhost(options) { .then(function () { customRedirectsMiddleware.reload(); - common.events.emit('server:start'); + common.events.emit('server.start'); return ghostServer; }); }