Tru*_*ran 3 http amazon-ec2 amazon-web-services
我正在 node.js 中构建一个应用程序,并使用 AWS EC2 来托管它。但是,我的 HTTP 请求不起作用。
我的应用程序分为两个存储库:app-ui和app-server. app-server包含我所有的服务器端代码/API。在 app-ui 中,我正在发出简单的 POST 请求,例如:
$.ajax({
type: "POST",
url: "http://ec2-xx-xxx-xx/api/users",
success: function(data) {
console.log(data);
},
error: function(a) {
console.log(a);
}
});
Run Code Online (Sandbox Code Playgroud)
但是,我不断收到net::ERR_CONNECTION_TIMED_OUT错误消息。
有谁知道可能会发生什么?