Compy / meteor-mobile-desktop

Sample showing how to break down a Meteor app into packages targeting both mobile and desktop experiences
MIT License
37 stars 4 forks source link

Question: running both simultaneously #1

Closed don-smith closed 9 years ago

don-smith commented 9 years ago

I'm curious if it's possible to run both the web and mobile clients at the same time (against the same mongo instance)? I can't find a way using the documented options. Thanks for this repo!

Compy commented 9 years ago

Hey Don,

Both actually run at the same time by default. So running 'meteor' spins up the main meteor instance. The mobile package automatically executes if the client is hitting the app from the cordova environment. The desktop package executes if the client is hitting the app from the browser.

For example, if you toss a Meteor.setInterval() function in both the mobile and desktop package server folders that runs on Meteor.startup(), you can see them both executing at the same time from a single meteor instance.

Since the two packages are running within the same meteor instance, they should automatically be pointed at the same mongo database. Its just a new way of thinking :)

don-smith commented 9 years ago

Thanks for your response. I've actually been using Meteor for a long time, but it wasn't until now that I've gotten around to using its Cordova features. I don't know why I was expecting something more complicated than what I already knew. I think the meteor run ios threw me for some reason. It was late at night ... that's the best excuse I have. :grimacing: Thanks again.