简体   繁体   English

具有多个域的单个Meteor应用程序

[英]Single Meteor application having multiple domains

Is it possible to create a single Meteor application having multiple domains and displaying different views/layouts depending on that domain? 是否可以创建一个具有多个域的Meteor应用程序,并根据该域显示不同的视图/布局?

For example, i have a admin interface accessible on admin.myapp.com and the two domains storeX.com and storeY.com . 例如,我有一个可在admin.myapp.com上访问的管理界面,以及两个域storeX.comstoreY.com Both domains should point to the data from admin.myapp.com but displaying the data (mostly) independently of each other. 两个域都应指向admin.myapp.com中的数据,但显示数据(大多数)彼此独立。

This may not be totally updated to 2014 standards, but I did answer this question before: 这可能不会完全更新到2014标准,但我之前回答过这个问题:

How can Meteor handle multiple Virtual Hosts? Meteor如何处理多个虚拟主机?

And with the same setup, you can use Passenger (for nginx OR apache2 ) for Meteor. 使用相同的设置,您可以使用Passenger (对于nginxapache2 )进行Meteor。 Here's a complete tutorial for using Passenger with Meteor , but keep in mind you have to integrate the multiple virtualhosts/domains to this tutorial yourself. 以下是使用Passenger with Meteor的完整教程 ,但请记住,您必须自己将多个虚拟主机/域集成到本教程中。

Perhaps a better approach would be to use Meteor's Pub/Sub capabilities, rather than sharing a DB per say. 也许更好的方法是使用Meteor的Pub / Sub功能,而不是按照说法共享数据库。 It's entirely possible to publish and subscribe across meteor apps, or indeed any implementation using DDP. 完全可以在流星应用程序之间发布和订阅,或者使用DDP实现任何实现。

http://docs.meteor.com/#/full/ddp_connect http://docs.meteor.com/#/full/ddp_connect

您可以使用分区程序根据所访问的域名将不同的数据视图发送给不同的用户。

See How can I share MongoDB collections between Meteor apps? 请参阅如何在Meteor应用程序之间共享MongoDB集合? . Basically the idea is that you build two meteor apps which would share the mongodb and collection(s) data. 基本上这个想法是你构建两个流星应用程序,它们将共享mongodb和集合数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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