i have the basic webserver hello world app for nodejs on windows and it works on localhost. But when i test it from the internet it cannot connect. I set up port forwarding in my netgear router. Am i missing a step here to make my nodejs server visible to the outside world?
Thanks.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World
');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…