【问题标题】:How to Post date to server on AWS EC2如何将日期发布到 AWS EC2 上的服务器
【发布时间】:2018-06-30 15:04:08
【问题描述】:

express-mongodb`后端部署在ASW EC2上的Linux服务器上,当我在个人电脑上测试后端时,我使用

http://localhost:3000/app_v1/api/users

与身体:

{
    "user_name" : "josh",
    "user_email" : "josh.M@gmail.com",
    "user_password" : "123"
}

注册一个用户,它运行良好。

现在我已经将它部署在 AWS EC2 (Ubantu 16.04) 上,并且想做同样的事情。我已经启动了 MongoDB 和节点服务器,它显示服务器在端口 3000 上启动。

试图通过邮递员将数据发布到服务器,但连接时显示出错

http://ec2-18-216-132-220.us-east-2.compute.amazonaws.com:3000/app_v1/api/users

with body:

{
    "user_name" : "josh",
    "user_email" : "josh.M@gmail.com",
    "user_password" : "123"
}

邮递员留言:

Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
Self-signed SSL certificates are being blocked:
Fix this by turning off 'SSL certificate verification' in Settings > General
Proxy configured incorrectly
Ensure that proxy is configured correctly in Settings > Proxy
Request timeout:
Change request timeout in Settings > General

【问题讨论】:

    标签: node.js mongodb amazon-web-services http amazon-ec2


    【解决方案1】:

    我只是想通了,我的服务器监听 3000 并且我不允许它在我的安全组中,将 3000 添加到入站并且它可以工作。

    【讨论】:

      猜你喜欢
      • 2020-05-29
      • 1970-01-01
      • 1970-01-01
      • 2012-12-09
      • 2012-12-26
      • 1970-01-01
      • 2020-10-29
      • 2021-04-28
      • 2014-12-25
      相关资源
      最近更新 更多