简体   繁体   中英

Using Meteor App on iPad that was deployed to remote server with Meteor-up (issue connecting to mongodb)

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?

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM