-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
bugBug reportsBug reports
Milestone
Description
- [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
Labels
bugBug reportsBug reports