diff --git a/lib/cmd.js b/lib/cmd.js index f9dac0b7..3dde287c 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -64,6 +64,7 @@ Cmd.prototype.run = function() { .command('run [environment]') .option('-p, --port [port]', 'port to run the dev webserver (default: 8000)') .option('-b, --host [host]', 'host to run the dev webserver (default: localhost)') + .option('--noserver', 'disable the development webserver') .description('run dapp (default: development)') .action(function(env, options) { self.Embark.initConfig(env || 'development', { @@ -72,7 +73,8 @@ Cmd.prototype.run = function() { self.Embark.run({ env: env || 'development', serverPort: options.port, - serverHost: options.host + serverHost: options.host, + runWebserver: !options.noserver }); }); }; diff --git a/lib/index.js b/lib/index.js index a6de53f7..82334d8e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -81,13 +81,17 @@ var Embark = { logger: Embark.logger, config: Embark.config, serverHost: options.serverHost, - serverPort: options.serverPort + serverPort: options.serverPort, + runWebserver: options.runWebserver }); Embark.servicesMonitor.startMonitor(); callback(); }, self.buildDeployGenerate.bind(self), function startAssetServer(callback) { + if (!options.runWebserver) { + return callback(); + } Embark.monitor.setStatus("Starting Server"); var server = new Server({ logger: self.logger, diff --git a/lib/services.js b/lib/services.js index 2fbec303..e59f685e 100644 --- a/lib/services.js +++ b/lib/services.js @@ -8,6 +8,7 @@ var ServicesMonitor = function(options) { this.config = options.config; this.serverHost = options.serverHost || 'localhost'; this.serverPort = options.serverPort || 8000; + this.runWebserver = options.runWebserver; }; ServicesMonitor.prototype.startMonitor = function() { @@ -65,7 +66,9 @@ ServicesMonitor.prototype.check = function() { }, function checkDevServer(result, callback) { self.logger.trace('checkDevServer'); - result.push(('dev server (http://' + self.serverHost + ':' + self.serverPort + ')').green); + var devServer = 'dev server (http://' + self.serverHost + ':' + self.serverPort + ')'; + devServer = (self.runWebserver) ? devServer.green : devServer.red; + result.push(devServer); callback(null, result); } ], function(err, result) {