A
A
Anton2015-08-28 18:34:08
Node.js
Anton, 2015-08-28 18:34:08

How to create an app on meteor subdomains?

There is a meteor app. It is necessary that on different subdomains (app1.myapp.com, app2.myapp.com, etc.) different modules are connected and there are different databases, but one user base. The problem is that I did not find a way to make such modules, recognize subdomains, and load only from the necessary folders, and not all at once
. An example of the proposed structure:

domains
 - app1
 - - config.json
 - - layout.html
 - app2
 - - config.json
 - - layout.html
modules
 - blog
 - chat

config.json
{
 requires: ["blog"]
}

how to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Timur Shemsedinov, 2015-08-28
@MarcusAurelius

Only one way, you need to run a separate server process for each subdomain, on a separate port. Then collect all these different applications through nginx into one port 80. But if you need to dynamically create domain names or there will be a lot of such subdomains, then you will not do it on such a stack. There will be 500 subdomains, then there will be 500 node processes, this will devour all the resources for switching processes.

B
banonotit, 2016-01-08
@banonotit

why?
you can make several scopes through vm and already use different connections and different libraries
there, well, like we have 1 node process that determines which subdomain the request was made to, and depending on the subdomain, it can execute, for example, a handler file in another scope

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question