Skip to content

Commit

Permalink
Start the dev server at the specified host
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GAumala authored and Timer committed Apr 19, 2017
1 parent 19e0386 commit 604519a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-scripts/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function runDevServer(host, port, protocol) {
addMiddleware(devServer);

// Launch WebpackDevServer.
devServer.listen(port, err => {
devServer.listen(port, host, err => {
if (err) {
return console.log(err);
}
Expand All @@ -303,7 +303,7 @@ function runDevServer(host, port, protocol) {

function run(port) {
var protocol = process.env.HTTPS === 'true' ? "https" : "http";
var host = process.env.HOST || 'localhost';
var host = process.env.HOST || '0.0.0.0';
setupCompiler(host, port, protocol);
runDevServer(host, port, protocol);
}
Expand Down

0 comments on commit 604519a

Please sign in to comment.