Restore the ability to use the --port command line argument (#588)

The behavior was changed in #516. With this change, both the command line argument and environment variable will work.
This commit is contained in:
Christopher Chedeau 2018-04-20 09:25:12 -07:00 committed by Yangshun Tay
parent c400636fb6
commit 1d4e334a86

View file

@ -37,7 +37,7 @@ const program = require('commander');
program.option('--port <number>', 'Specify port number').parse(process.argv);
let port = process.env.PORT || 3000;
let port = parseInt(program.port, 10) || process.env.PORT || 3000;
let numAttempts = 0;
const MAX_ATTEMPTS = 10;
checkPort();