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 hansl committed May 9, 2017
1 parent 31fbf00 commit 23c039d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/@angular/cli/tasks/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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 @@ -181,7 +181,8 @@ 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 23c039d

Please sign in to comment.