I have few basic questions about global variables and different backends as mentioned below, please provide your inputs on the same:
-
Is there any way I can use global or environment variables in the service/route/plugin ? For example, backend hostname on dev env is dev-mysite.com and for QA and prod it is qa-mysite.com and prod-mysite.com
So when configuring service I will simply add env or global variable outside of service/route/plugin and call it in the host section of service. so my hostname will be dynamically populated.
This is useful when you promote your code from lower env to higher. -
Based on the request values, I want to route the request to different backends. Is there any way that I can define different backend for the same request and invoke the backend url based on the input request param values?
-
Are there default built in service/route/plugin variables that will be assigned with values during or post execution of service/route/plugin ? And the same we can use in further processing of the request in the flow ?