From 24f8d89c93ca65a284a8f90b7dcf7d394a222638 Mon Sep 17 00:00:00 2001 From: Lucas Constantino Silva Date: Thu, 4 Dec 2014 18:04:01 -0200 Subject: [PATCH 1/2] Add event emitter to the server to allow ultimate changes to application settings; useful for testing purposes. --- lib/server.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/server.js b/lib/server.js index bf9745a..2ff9524 100644 --- a/lib/server.js +++ b/lib/server.js @@ -169,6 +169,9 @@ Server.prototype.addApplication = function(hostname, dir, callback) { // Load and merge all the settings. lodash.merge.apply(null, [settings].concat(mergingSettings)); + // Allow for custom changes on settings. + server.emit('applicationSettings', hostname, settings); + var application = this.applications[hostname] = new Application(this.mainApplication, hostname, settings); // Add a reference to the server to be used by the installer. From 84fcf7016e12580efc86bf4644b69d25fd6c6990 Mon Sep 17 00:00:00 2001 From: Lucas Constantino Silva Date: Thu, 4 Dec 2014 18:32:40 -0200 Subject: [PATCH 2/2] Added server auto-reference variable to addApplication method. --- lib/server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/server.js b/lib/server.js index 2ff9524..bf322bc 100644 --- a/lib/server.js +++ b/lib/server.js @@ -123,6 +123,7 @@ Server.prototype.getApplication = function(hostname) { * @param {Function} callback Function to run when the application is started. */ Server.prototype.addApplication = function(hostname, dir, callback) { + var server = this; var modes = []; var mergingSettings = []; var applicationPaths = {