Node.js/Express.js App Only Works on Port 3000

后端 未结 16 2216
暖寄归人
暖寄归人 2020-12-12 13:23

I have a Node.js/Express.js app running on my server that only works on port 3000 and I\'m trying to figure out why. Here\'s what I\'ve found:

  • Without specifyi
16条回答
  •  不思量自难忘°
    2020-12-12 14:07

    The default way to change the listening port on The Express framework is to modify the file named www in the bin folder.

    There, you will find a line such as the following

    var port = normalizePort(process.env.PORT || '3000');
    

    Change the value 3000 to any port you wish.

    This is valid for Express version 4.13.1

提交回复
热议问题