From 14275c7cfe654aadbee091b1265b09cf48ee2a6a Mon Sep 17 00:00:00 2001 From: Dan Bucholtz Date: Mon, 14 Nov 2016 22:21:03 -0600 Subject: [PATCH] fix(serve): open browser to localhost open browser to localhost --- src/serve.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/serve.ts b/src/serve.ts index 3b131d2c..e79275cc 100644 --- a/src/serve.ts +++ b/src/serve.ts @@ -50,15 +50,15 @@ export function serve(context?: BuildContext) { } function onReady(config: ServeConfig, context: BuildContext) { + const host = config.host === '0.0.0.0' ? 'localhost' : config.host; if (config.launchBrowser || config.launchLab) { - const openOptions: string[] = [`http://${config.host}:${config.httpPort}`] + const openOptions: string[] = [`http://${host}:${config.httpPort}`] .concat(launchLab(context) ? [IONIC_LAB_URL] : []) .concat(browserOption(context) ? [browserOption(context)] : []) .concat(platformOption(context) ? ['?ionicplatform=', platformOption(context)] : []); open(openOptions.join(''), browserToLaunch(context)); } - const host = config.host === '0.0.0.0' ? 'localhost' : config.host; Logger.info(`dev server running: http://${host}:${config.httpPort}/`, 'green', true); Logger.newLine(); }