From ee95461cb122eda7f60c8d5bddda323a2aa2e668 Mon Sep 17 00:00:00 2001 From: Blake Kostner Date: Thu, 26 Jul 2018 07:52:00 -0600 Subject: [PATCH] resolve server listen details with server.address() (#3529) * resolve server listen details with server.address() * remove empty whitespace * overwrite host and port in server listen method * no let --- lib/core/nuxt.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/core/nuxt.js b/lib/core/nuxt.js index 227aa78987..1173dd87da 100644 --- a/lib/core/nuxt.js +++ b/lib/core/nuxt.js @@ -129,6 +129,11 @@ export default class Nuxt { return reject(err) } + ({ host, port } = server.address()) + if (['127.0.0.1', '0.0.0.0'].includes(host)) { + host = 'localhost' + } + const listenURL = chalk.underline.blue(`http://${host}:${port}`) this.readyMessage = `Listening on ${listenURL}`