Steve Schwarz
Aug 31, 2018 · 1 min read

Thank you for such a detailed solution and explanation!

With this approach I could use configuration info to point the Angular app to different REST API URLs for testing/beta/production environments. How do you handle building a single Angular image that can be deployed to multiple environments? Once the app is tested I’d like to deploy exactly that image and not rebuild with a different configuration.

For example the URLs for testing might deploy the Angular to:
http://app-test.example.com which communicates to a backend REST API at http://test.api.example.com

Then in production the Angular app would be served at http://app.example.com and it would communicate with the REST API at http://api.example.com.

Is there a smart way to do that? I was thinking of using naming convention for the REST API service(s) so the Angular app could “build” the URL(s) of it’s REST API(s) when it runs based on the domain it is hosted on? e.g. app at http://app.example.com then REST API would be at http://api.example.com

Test env app at http://app.test.example.com w/REST API at http://api.test.exampe.com and so on.

Or do people just rebuild for each environment? THANKS!

    Steve Schwarz

    Written by

    The web/technology me