Meteor: one backend - multiple different front-ends 2x web and 1x mobile

别来无恙 提交于 2019-12-23 00:26:28

问题


I want one meteor server that can serve multiple different front-ends:

  • Simple Web App
  • Admin Web App
  • Mobile App

Each app has almost completely different HTML. Having all 3 packaged together isn't a blocker for the Admin and Mobile apps, but it is a blocker if the Simple Web app gets bloated with code from the other two.

I don't understand enough about the Meteor build process to work out a solution. I could really use some help with best practices

Some things I've tried:

  1. Separate apps -> separate repos. I got stuck trying to point the Mobile App at the Simple App repo.
  2. Separate apps -> same repo. Not sure how to organize this. Meteor seems pretty sure everything is one app
  3. One App -> One repo. App detects mobile and uses different template? device-detection looks abandoned (asked for a PR for iron-router, but never merged it).

Any suggestions? If your Meteor site's mobile app is almost completely different than its web app, how do you manage it?


回答1:


I've been using symlinks and it's been successful. Here's how my git repo looks (more or less):

/all
/all/public
/all/client
/all/server

/app1/client
/app1/client/shared -> symlink to ../../all/client
/app1/server/shared -> symlink to ../../all/server
/app1/public        -> symlink to ../all/public

/app1/client
/app1/client/shared -> symlink to ../../all/client
/app1/server/shared -> symlink to ../../all/server
/app1/public        -> symlink to ../all/public

Cheers!



来源:https://stackoverflow.com/questions/32237778/meteor-one-backend-multiple-different-front-ends-2x-web-and-1x-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!