ibm-cloud-architecture / refarch-cloudnative-wfd-ui

A microservices sample application component, displaying a simple UI from a backend service call
0 stars 8 forks source link

parametrise base_url #8

Open jesusmah opened 7 years ago

jesusmah commented 7 years ago

base_url needs to be parametrised so that it can dynamically change depending on the environment the application is deployed to.

base_url can be found in /src/app/menu/menu.service.ts

Hemankita commented 7 years ago

Parameterized the basr_url. For now, used the url in the localhost. But later it should be later replaced with the original url.

jesusmah commented 7 years ago

base_url value has been pushed out to pom.xml file but yet can not be dynamically changed. That is, menu-ui microservice must be re-compiled/re-built in order to get the base_url value changed.

The idea here is to extract such configuration so that it can be injected at "run-time". For instance, we would like to have a different configuration (i.e. different base_url value) depending on where we are going to deploy (i.e. dev, test, qa, production...).

Pushing values out to pom.xml file works for the MicroProfile based microservices since these can change at run-time when we execute mvn liberty:start-server. New values and variables can be passed to the JVM at that time overwriting old ones. However, the node/angular application does not run in any JVM but instead is client side code executed in the browser. Thus, we need to find out another way to dynamically change the value for base_url.

I've found the following links that may be helpful:

Have a read at them to see if what I am saying makes sense. Also, we can ask BC guys to give us a hand as I believe they have more experience in node/angular. Finally, this should not be a show stopper so I don't want us stuck here for days.