what is process.env.PORT || 3000 used for in Node.js? I saw this somewhere:

 app.set('port', process.env.PORT || 3000);

If it is used to set 3000 as the listening port, can I use this instead?

app.listen(3000);

If not why?

7 Answers
7

Leave a Reply

Your email address will not be published. Required fields are marked *