Running Hello World using Node js Express in cloud 9IDE

眉间皱痕 提交于 2019-12-14 03:46:25

问题


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?


回答1:


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!



来源:https://stackoverflow.com/questions/15087953/running-hello-world-using-node-js-express-in-cloud-9ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!