if port === 0 (per cli or config), auto-assign a port

This commit is contained in:
Michael Bradley, Jr 2018-09-17 17:54:31 -05:00
parent c6232de878
commit ebcbc1efe6

View File

@ -65,6 +65,11 @@ class WebServer {
}
testPort(done) {
if (this.port === 0) {
this.logger.warn(__('Assigning an available port'));
this.server.port = 0;
return done();
}
utils.pingEndpoint(this.host, this.port, 'http', 'http', '', (err) => {
if (err) { // Port is ok
return done();