Deploy same build to multiple subdomains in Angular 8

729 views
Skip to first unread message

RAVIKIRAN GUTURU

unread,
Jun 28, 2020, 2:06:48 AM6/28/20
to Angular and AngularJS discussion
Hi

I have a scenario where same codebase has to be deployed to multiple clients (lets say 4) like Client1.domain.com, Client2.domain.com, client3.domain.com, client4.domain.com and each will have separate environment file

How do we achieve this? Do we need to create 4 dist folders and map it to respective url?

Can we map same dist folder to 4 urls and get the environment settings at runtime thru API.?

RAVIKIRAN GUTURU

unread,
Jun 28, 2020, 2:06:48 AM6/28/20
to Angular and AngularJS discussion
I have a scenario where the codebase is same for all clients except different environment.ts for each client and the URLS are client1.domain.com, client2.domain.com, client3.domain.com, client4.domain.com etc for each client.

How do we achieve this in Angular 8? Do we need to create separate dist folder for each client and map it to respective URL? 
Are there any best approaches to achieve this? can we map subdomains urls to single dist folder and get the respective environment settings from API at runtime?


Sander Elias

unread,
Jun 28, 2020, 11:49:41 PM6/28/20
to Angular and AngularJS discussion
That is the easiest to implement solution available yes.

However, if the data in your environments isn't sensitive, you can serialize it, and dynamically pick one depending on domain name.

Regards
Sander

RAVIKIRAN GUTURU

unread,
Jun 30, 2020, 3:33:12 AM6/30/20
to ang...@googlegroups.com
Thanks

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/f85246c2-241f-40a8-9da0-2eb6d7202206o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages