Closed 137-rick closed 2 years ago
I think it's a good idea too. Sometimes we need to use one script for multiple domains such as custom domain service. So I agree for this.
I think it's a very good idea, several other routers have already integrated a domain and subdomain management concept.
I handle this one by just not compiling the hostname into the route. https://github.com/daft-framework/daft-router/blob/e96ba423cfa5ea49c7369e43653633c9a14ad81b/src/Router/Dispatcher.php#L58
I assume this is about having parameters inside the hostname, like "{user}.mydomain.xyz" -- right? Because if you only need separate route collections for different hostnames, you can just use separate route collections.
Using the hostname as a prefix does not seem like a good idea as it will create a bigger route collection and that will negatively impact the routing performance.
I really don't think it's wise to have a big collection for different domains. As highlighted by @kktsvetkov it will have an impact on performance.
now i was 'new' three fastRouter object for three domain how about consider to make this support multiple domain for one dispatcher?