Launch Hello World with Node js Express in the 9IDE Cloud

I successfully executed hello world in an IDE cloud using node JS express framework, replacing

app.listen(3000); 

to

 app.listen(process.env.PORT); 

cloud 9 asks me to use process.env.IP as the host for the scripts. Which file to open to replace the host name with process.env.IP?

+4
source share
1 answer

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 this works!

+7
source

All Articles