在AWS ec2 t1.micro上使用node.js?

我正在尝试“Hello World”node.js脚本,但我跑到打嗝….我正在执行该程序,但它不是连接到我的本地主机:8080因为我执行程序后,当我走到我的浏览器,我得到一个Chrome“哎呀谷歌无法find”页面。 我正在Windows上的Cygwin的一个AWS t1.micro ec2实例中运行,所以我不确定它是否是一个CPU问题,但我对发生的事情感到困惑,而且我不想在理解原因的情况下前进。

var http = require("http"); //How we require modules http.createServer(function(request, response) { response.writeHead(200); //Status code in header response.write("Hello World!"); //Response body response.end(); // close the connection }).listen(8080); console.log('Listening on port 8080...'); 

你的铬也运行在相同的t1.micro? 否则,您需要使用实例的IP地址/域名。

确保您的安全组允许从本地计算机访问端口8080。