mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 10:17:55 +02:00
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:
parent
c400636fb6
commit
1d4e334a86
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ const program = require('commander');
|
||||||
|
|
||||||
program.option('--port <number>', 'Specify port number').parse(process.argv);
|
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;
|
let numAttempts = 0;
|
||||||
const MAX_ATTEMPTS = 10;
|
const MAX_ATTEMPTS = 10;
|
||||||
checkPort();
|
checkPort();
|
||||||
|
|
Loading…
Add table
Reference in a new issue