Skip to content

Commit

Permalink
fix(develop): always use port from cli args
Browse files Browse the repository at this point in the history
Use -p 8080 as workaround for random port given by portfinder.

See: http-party/node-portfinder#84
  • Loading branch information
hjvedvik committed Aug 19, 2019
1 parent 17c282e commit d94c76c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gridsome/lib/app/loadConfig.js
Expand Up @@ -71,7 +71,7 @@ module.exports = (context, options = {}) => {

config.pkg = options.pkg || resolvePkg(context)
config.host = args.host || localConfig.host || 'localhost'
config.port = parseInt(args.port || localConfig.port, 10) || 8080
config.port = parseInt(args.port || localConfig.port, 10) || null
config.plugins = normalizePlugins(context, plugins)
config.transformers = resolveTransformers(config.pkg, localConfig)
config.pathPrefix = normalizePathPrefix(isProd ? localConfig.pathPrefix : '')
Expand Down
2 changes: 1 addition & 1 deletion gridsome/lib/server/createExpressServer.js
Expand Up @@ -12,7 +12,7 @@ const endpoint = {
}

module.exports = async (app, options = {}) => {
const port = await resolvePort(app.config.port)
const port = app.config.port || await resolvePort()
const { config, schema } = app
const server = express()

Expand Down

0 comments on commit d94c76c

Please sign in to comment.