Seperate mobile and web apps with same server

Hi,

So this topic has come up a lot. I thought I understood it, but when implementing it, things didn’t go as planned.

I’d like to use the same server for my mobile and web app, but different client code for each. I thought I could just do meteor run-android --mobile-server example.com and it’d all work, but when I do that, the mobile views just gets replaced with the web app when the mobile app connects to the server.

I know I can split my app up into different packages. One for cordova and one for a regular browser, but I was hoping to be able to develop two completely separate apps that shared the same server code using symlinks. If I turn off hot code push, would that fix my problems? (I don’t mind losing that ability for my mobile app).

Did you ever get an answer for this?

Hi Chris,

I did manage to solve my issues. I’m not even sure what my question was anymore :slight_smile:

What I did in the end was create a new meteor project, then symlink to the server folder since I want to use them for both Web and cordova. There are files that also need to be shared such as files defining collections and their schemas.

Then you can start implementing a new client for your mobile app in the new project. When you deploy you need to set the MONGO_URL field to the same as your Web apps database.

Using packages would probably be a cleaner solution but would have been a lot more time for me to setup since I would have had to refactor my app majorly.