问题
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