问题
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:
- Separate apps -> separate repos. I got stuck trying to point the Mobile App at the Simple App repo.
- Separate apps -> same repo. Not sure how to organize this. Meteor seems pretty sure everything is one app
- 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