mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 23:20:50 +00:00
Merge pull request #2065 from nasa/bind-to-loopback
Modified Express startup so that it only binds to loopback by default
This commit is contained in:
commit
e03ea25392
5
app.js
5
app.js
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
options.port = options.port || options.p || 8080;
|
options.port = options.port || options.p || 8080;
|
||||||
|
options.host = options.host || options.h || 'localhost'
|
||||||
options.directory = options.directory || options.D || '.';
|
options.directory = options.directory || options.D || '.';
|
||||||
['include', 'exclude', 'i', 'x'].forEach(function (opt) {
|
['include', 'exclude', 'i', 'x'].forEach(function (opt) {
|
||||||
options[opt] = options[opt] || [];
|
options[opt] = options[opt] || [];
|
||||||
@ -78,7 +79,7 @@
|
|||||||
app.use(express['static'](options.directory));
|
app.use(express['static'](options.directory));
|
||||||
|
|
||||||
// Finally, open the HTTP server and log the instance to the console
|
// Finally, open the HTTP server and log the instance to the console
|
||||||
app.listen(options.port, function() {
|
app.listen(options.port, options.host, function() {
|
||||||
console.log('Open MCT application running at localhost:' + options.port)
|
console.log('Open MCT application running at %s:%s', options.host, options.port)
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user