From 655f56f893a94e4d4c1271e4e02768b14c13a432 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sat, 29 Oct 2016 22:00:54 -0400 Subject: [PATCH] support --noserver option --- lib/cmd.js | 4 +++- lib/index.js | 6 +++++- lib/services.js | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/cmd.js b/lib/cmd.js index f9dac0b7d..3dde287c5 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 a6de53f7a..82334d8e5 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 2fbec303d..e59f685ef 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) {