Skip to content

core/scripts/server.js #1715

@zadigus

Description

@zadigus
  • [bug] What is the current behavior?

The following code is probably not what you want:

let port = process.env.PORT || config.server.port
const host = process.env.HOST || config.server.host
const start = () => {
  app.listen(port, host)
    .on('listening', () => {
      console.log(`Vue Storefront Server started at http://${host}:${port}`)
    })
    .on('error', (e) => {
      if (e.code === 'EADDRINUSE') {
        console.log(`${port} already in use, trying ${port + 1}`)
        port = port + 1
        start()
      }
    })

Indeed, it does not increase the port number, but concatenates 1 after the port. For example, if port 8080 is used, then this code will try with 80801 and not 8081.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug reports

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions