mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 14:24:24 +00:00
if port === 0 (per cli or config), auto-assign a port
This commit is contained in:
parent
c6232de878
commit
ebcbc1efe6
@ -65,6 +65,11 @@ class WebServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testPort(done) {
|
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) => {
|
utils.pingEndpoint(this.host, this.port, 'http', 'http', '', (err) => {
|
||||||
if (err) { // Port is ok
|
if (err) { // Port is ok
|
||||||
return done();
|
return done();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user