Skip to content

Commit

Permalink
Improved syntax for determining port
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Jul 2, 2017
1 parent 6655ed6 commit dae446e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/options.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit dae446e

Please sign in to comment.