From 598fbb779523079f90ab2badfad787c51a343955 Mon Sep 17 00:00:00 2001 From: Drake Costa Date: Tue, 27 Mar 2018 02:22:01 -0700 Subject: [PATCH] Add "--port" Option Allows passing an additional command line option `-p ` or `--port `, which overrides the default server port of 9000. --- bin/cmd.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cmd.js b/bin/cmd.js index e473a769..1313b294 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -17,13 +17,14 @@ program.version(pkg.version); program .option("-c --config ", "additional webpack configuration") + .option("-p --port ", "port to serve from (default: 9000)") program .command("serve ") .description("serve and watch functions") .action(function(cmd, options) { console.log("Starting server"); - var server = serve.listen(9000); + var server = serve.listen(program.port || 9000); build.watch(cmd, program.config, function(err, stats) { if (err) { console.error(err);