问题
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.
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";
});
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.
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
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?
回答1:
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.
This is probably just : ipaddress:port
Meteor's Explanation is here : https://www.meteor.com/try/7
If you use this command :
meteor run ios-device --mobile-server ipaddress:port
Then you should just need to keep the Meteor (server) running on your server (from a separate window).
来源:https://stackoverflow.com/questions/28843616/using-meteor-app-on-ipad-that-was-deployed-to-remote-server-with-meteor-up-issu