fardown
fardown

Reputation: 748

Running Hello World using Node js Express in cloud 9IDE

I successfully ran hello world in cloud 9 IDE using node JS express framework by replacing

app.listen(3000);

to

app.listen(process.env.PORT);

cloud 9 is asking me to use process.env.IP as the host for the scripts. Which file do I open to replace the host name to process.env.IP?

Upvotes: 4

Views: 6125

Answers (1)

Renato Gama
Renato Gama

Reputation: 16519

You can call listen with an additional parameter like this:

app.listen(3000, '192.168.0.100');

or,

app.listen(process.env.PORT, process.env.IP);

So this should be what you are looking for. Let me know if it works!

Upvotes: 7

Related Questions