From e631818268c8fc3a3c071c32437764941bdd6590 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 14 Jun 2017 10:27:29 +0200 Subject: [PATCH] format probable server URL when printing to the console at launch --- server.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 289184d8a..ec89ef2af 100644 --- a/server.js +++ b/server.js @@ -138,7 +138,13 @@ app.get('/api/config', function(req, res){ var httpServer = httpsOpts ? Https.createServer(httpsOpts, app) : Http.createServer(app); httpServer.listen(config.httpPort,config.httpAddress,function(){ - console.log('[%s] listening on port %s', new Date().toISOString(), config.httpPort); + var host = config.httpAddress; + var hostName = !host.indexOf(':') ? '[' + host + ']' : host; + + var port = config.httpPort; + var ps = port === 80? '': ':' + port; + + console.log('\n[%s] server available http://%s%s', new Date().toISOString(), hostName, ps); }); var wsConfig = { server: httpServer };