在iPad上使用Meteor App,使用Meteor-up部署到远程服务器(连接到mongodb的问题) [英] Using Meteor App on iPad that was deployed to remote server with Meteor-up (issue connecting to mongodb)

查看:441
本文介绍了在iPad上使用Meteor App,使用Meteor-up部署到远程服务器(连接到mongodb的问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 Meteor-up 将Meteor应用程式部署到我自己的伺服器上out只是罚款,如果我尝试通过我的浏览器连接到它。现在,我想通过我的iPad连接到应用程序。

I've deployed a Meteor app to my own server with Meteor-up which has worked out just fine if I try to connect to it through my browser. Now, I'm trying to connect to the app via my iPad.

我使用命令 sudo meteor run ios-device 构建了该应用程序,并在Meteor.startup函数中启用了MONGO_URL:

I've built said app with the command sudo meteor run ios-device and envoked the MONGO_URL in the Meteor.startup function:

Meteor.startup(function () {
        process.env.MONGO_URL = "mongodb://user:password@ipaddress:port/meteor";
    });

问题是我无法连接到Meteor-up创建的mongo数据库。 做一些挖掘后,我意识到Meteor-up具体说你不能从服务器外部访问MongoDB。

The issue is that I'm unable to connect to the mongo database that was created by Meteor-up. After doing some digging, I realized that Meteor-up specifically says you cannot access the MongoDB from outside the server.


您无法从伺服器外部存取MongoDB。要访问
MongoDB shell你需要先通过SSH登录你的服务器,然后运行
,然后运行以下命令:

You can't access the MongoDB from the outside the server. To access the MongoDB shell you need to log into your server via SSH first and then run the following command:

mongo appName

mongo appName

相反,我试图加载一个我在本地创建到我的服务器上的mongo数据库,但仍然无法在iPad上访问。我找到了潜在的解决方法这个问题使用pymongo,但我不知道什么其他解决方案在那里,当使用Meteor-Up。或者在处理移动设备时也可能有更好的流星部署选项?

Instead, I attempted to load a mongo database that I had created locally onto my server, but still am unable to reach it on the iPad. I found a potential work-around for this issue that uses pymongo but am wondering what other solutions are out there when using Meteor-Up. Or perhaps there may be a better meteor deployment option when dealing with mobile devices as well?

推荐答案

如果您要访问应用在你的ipad上,你不需要连接到Mongo DB,而是到Meteor服务。

If you want to access the app on your ipad, you shouldn't need to connect to the Mongo DB, but to the Meteor service.

这可能只是:ipaddress:port

This is probably just : ipaddress:port

Meteor的说明在这里:
https://www.meteor.com/try/7

Meteor's Explanation is here : https://www.meteor.com/try/7

如果您使用此命令:

meteor运行ios设备--mobile服务器ipaddress:端口

然后,您应该只需要保持Meteor(服务器)在您的服务器上运行(从单独的窗口)。

Then you should just need to keep the Meteor (server) running on your server (from a separate window).

这篇关于在iPad上使用Meteor App,使用Meteor-up部署到远程服务器(连接到mongodb的问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆