diff --git a/lib/server.js b/lib/server.js index bf9745a..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 = { @@ -169,6 +170,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.