From 7247176ee048a2b24c6990738cc49e09ed4a8bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Sun, 6 May 2018 12:21:11 +0200 Subject: [PATCH] Use options object with server.listen --- lib/server-impl.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/server-impl.js b/lib/server-impl.js index 20e8f3f8ea..9b1a1d80ca 100644 --- a/lib/server-impl.js +++ b/lib/server-impl.js @@ -29,10 +29,13 @@ function createApp(options) { startMonitoring(options.serverMetrics, eventBus); return new Promise(resolve => { - const server = app.listen(app.get('port'), options.host, () => { - logger.info(`Unleash started on port ${server.address().port}`); - resolve({ app, server, eventBus }); - }); + const server = app.listen( + { port: options.port, host: options.host }, + () => { + logger.info(`Unleash started on port ${server.address().port}`); + resolve({ app, server, eventBus }); + } + ); }); }