NodeJS HTTP - listen on other port than 80

后端 未结 6 902
情歌与酒
情歌与酒 2021-01-12 00:21

I am running XAMPP on Windows to host an Apache server on port 80. Now I\'m trying to have a NodeJS script running in the background but the problem is that it can only list

6条回答
  •  南方客
    南方客 (楼主)
    2021-01-12 01:08

    Just change your node.js server port something like:

    var server = app.listen(8080, function() {
        console.log('Ready on port %d', server.address().port);
    });
    

    where 8080 is node.js server' new port.

提交回复
热议问题