Skip to content

Commit

Permalink
fix(@angular/cli): open option in serve command should open localhost…
Browse files Browse the repository at this point in the history
… when host is 0.0.0.0

Close #5743
  • Loading branch information
RicardoVaranda authored and filipesilva committed May 8, 2017
1 parent c6a8fcb commit 27059e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@angular/cli/tasks/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default Task.extend({

const serverAddress = url.format({
protocol: serveTaskOptions.ssl ? 'https' : 'http',
hostname: serveTaskOptions.host,
hostname: serveTaskOptions.host === '0.0.0.0' ? 'localhost' : serveTaskOptions.host,
port: serveTaskOptions.port.toString()
});
let clientAddress = serverAddress;
Expand Down Expand Up @@ -179,7 +179,7 @@ export default Task.extend({

ui.writeLine(chalk.green(oneLine`
**
NG Live Development Server is running on ${serverAddress}
NG Live Development Server is listening on ${serveTaskOptions.host}:${serveTaskOptions.port}, open your browser on ${serverAddress}
**
`));

Expand Down

0 comments on commit 27059e7

Please sign in to comment.