In karate-config.js I set the baseUrl based on an environment. I want to be able to get this url in Java so I can get the corresponding server name in the url. Please show me how to do this. My karate-config.js looks something like this:
if (env == 'test') {
var baseUrl = 'http://server1:8080/api';
} else if (env == 'dev') {
var baseUrl = 'http://server2:8080/api';
}
I wrote a Java utility to connect to the database and run a query. But I need to know if the database is on server1 or server2 as in the example.