Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Aug 18, 2017
1 parent ac33c8a commit 328ac3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bin/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const cli = require('meow')(
s: 'silent'
},
default: {
poll: false
poll: false,
port: 3000
}
}
)
Expand Down
4 changes: 1 addition & 3 deletions bin/serve/get-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

const getPort = require('get-port')

const DEFAULT_PORT = 3000

module.exports = async cli => {
const envPort = process.env.port || process.env.PORT
if (envPort) return envPort

const { port: userPort = DEFAULT_PORT } = cli
const { port: userPort } = cli

const port = await getPort(userPort)
const inUse = port !== userPort
Expand Down

0 comments on commit 328ac3b

Please sign in to comment.