Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/scripts/server.js #1715

Closed
zadigus opened this issue Sep 8, 2018 · 1 comment
Closed

core/scripts/server.js #1715

zadigus opened this issue Sep 8, 2018 · 1 comment
Labels
bug Bug reports
Milestone

Comments

@zadigus
Copy link

zadigus commented Sep 8, 2018

  • [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.

@pkarw pkarw added the bug Bug reports label Sep 8, 2018
@pkarw pkarw added this to the 1.4 milestone Sep 8, 2018
@pkarw
Copy link
Collaborator

pkarw commented Sep 8, 2018

Thanks!

@pkarw pkarw closed this as completed Sep 12, 2018
@pkarw pkarw mentioned this issue Sep 12, 2018
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports
Projects
None yet
Development

No branches or pull requests

2 participants