From dae446eb35480cb1db3fedd7e37983378093945c Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Sun, 2 Jul 2017 17:58:08 +0200 Subject: [PATCH] Improved syntax for determining port --- lib/options.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/options.js b/lib/options.js index 1402f1c0..33fe8f8b 100644 --- a/lib/options.js +++ b/lib/options.js @@ -1,10 +1,11 @@ +const envPort = process.env.PORT +const defaultPort = isNaN(envPort) ? 5000 : parseInt(envPort, 10) + exports.options = [ { name: 'port', description: 'Port to listen on', - defaultValue: isNaN(process.env.PORT) - ? 5000 - : parseInt(process.env.PORT, 10) + defaultValue: defaultPort }, { name: 'cache',