Skip to content

Commit

Permalink
Restore the ability to use the --port command line argument (#588)
Browse files Browse the repository at this point in the history
The behavior was changed in #516. With this change, both the command line argument and environment variable will work.
  • Loading branch information
vjeux authored and yangshun committed Apr 20, 2018
1 parent c400636 commit 1d4e334
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/start-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1d4e334

Please sign in to comment.