【发布时间】:2016-07-15 01:21:51
【问题描述】:
我有一个 Amazon EC2 Ubuntu 实例,其中包含来自 GitHub project 的 MongoDB、Node.JS 和 Parse Server 示例。
我已将 Parse.com 迁移到实例上的 MongoDB。它的地址是mongodb://usr:****@xxx.xxx.xxx.xxx:27017/euro。
我已经在/var/www/parse 中安装了来自 GitHub 的 Parse Server 示例。
当我运行服务器时,我收到以下消息:
$ cd /var/www/parse
$ npm run start
> parse-server-example@1.4.0 start /var/www/parse
> node index.js
DATABASE_URI not specified, falling back to localhost.
parse-server-example running on port 1337.
Parse LiveQuery Server starts running.
我的问题是什么指向localhost?公共DNS?公网IP?
如何在 Android 应用中使用此代码连接到服务器?
Parse.initialize(new Parse.Configuration.Builder(myContext)
.applicationId("YOUR_APP_ID")
.server("http://YOUR_PARSE_SERVER:1337/parse")
.build()
);
当我尝试使用此地址 http://ec2-xxx-xxx-xxx-xxx.compute-x.amazonaws.com:1337/parse(公共 DNS)通过浏览器打开它时,我收到一条消息说连接已停止。
当我尝试使用此地址 http://xxx.xxx.xxx.xxx:1337/parse(公共 IP)通过浏览器打开它时,我收到一条消息说连接已停止。
【问题讨论】:
-
在你的安全组中打开端口?
-
是的,我确实打开了端口
标签: android mongodb parse-platform amazon-ec2