Skip to content

Commit 604519a

Browse files
GAumalaTimer
authored andcommitted
Start the dev server at the specified host
Pass the host from environment variable as argument of the devServer's listen function instead of a field of options object. Set the default host to 0.0.0.0 instead of localhost.
1 parent 19e0386 commit 604519a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-scripts/scripts/start.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ function runDevServer(host, port, protocol) {
286286
addMiddleware(devServer);
287287

288288
// Launch WebpackDevServer.
289-
devServer.listen(port, err => {
289+
devServer.listen(port, host, err => {
290290
if (err) {
291291
return console.log(err);
292292
}
@@ -303,7 +303,7 @@ function runDevServer(host, port, protocol) {
303303

304304
function run(port) {
305305
var protocol = process.env.HTTPS === 'true' ? "https" : "http";
306-
var host = process.env.HOST || 'localhost';
306+
var host = process.env.HOST || '0.0.0.0';
307307
setupCompiler(host, port, protocol);
308308
runDevServer(host, port, protocol);
309309
}

0 commit comments

Comments
 (0)