1

I am working on a project which has Angular5 for UI and rest APIs are written in Springboot application. I have two production environments for my application. I want to deploy my angular code in both Production environments. Right now we do not have automated build and the Prod deployment team takes care of manual deployment. Current steps what we follow for deployment are as below.
1. Rest APIs war deployed on Prod1 & Prod2 server
2. In angular environment.ts file, I have pointed Prod1 rest api URLs. with this configuration, I make angular build
3. Provide the dist folder to deployment team. Deployment team will copy the dist folder under tomcat webapps folder

My problem is, If I have to point the Prod2 URLs in environment.ts file, I have to make another angular build. I do not want to make separate build rather I am looking for some solution which switches the rest api URLs based on the environment. Both angular and rest apis are on same server.

Or is there a way to externalize the configuration and keep it on server and read it from there. Please let me know what I am missing here.

Vikas
  • 11,859
  • 7
  • 45
  • 69
MSV
  • 155
  • 2
  • 16
  • see this https://stackoverflow.com/questions/43234536/most-modern-way-to-externalize-angular-2-environment-configuration – Vikas Mar 30 '18 at 02:51
  • see my answer here: https://stackoverflow.com/questions/46441288/how-to-build-once-and-deployed-multiple-environments-using-angular-cli-4/48229711#48229711 – GreyBeardedGeek Mar 30 '18 at 03:55
  • Or here too https://stackoverflow.com/questions/49559009/angular5-deploying-angular-application-to-multiple-clients/49559443#49559443 – David Mar 30 '18 at 07:24

0 Answers0