From 56c16ed263944c18589c7406b205f8582671ec7e Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 8 Jun 2018 09:45:44 -0700 Subject: [PATCH] Modified Express startup so that it only binds to loopback by default --- app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 6b7b1bb635..5da16d8f51 100644 --- a/app.js +++ b/app.js @@ -19,6 +19,7 @@ // Defaults options.port = options.port || options.p || 8080; + options.host = options.host || options.h || 'localhost' options.directory = options.directory || options.D || '.'; ['include', 'exclude', 'i', 'x'].forEach(function (opt) { options[opt] = options[opt] || []; @@ -78,7 +79,7 @@ app.use(express['static'](options.directory)); // Finally, open the HTTP server and log the instance to the console - app.listen(options.port, function() { - console.log('Open MCT application running at localhost:' + options.port) + app.listen(options.port, options.host, function() { + console.log('Open MCT application running at %s:%s', options.host, options.port) }); }());