get-local-endpoint
get-local-endpoint
is a library that allows retrieving endpoints from environment variables.
This is designed for use cases where the API endpoint is defined via environment variables, which
allows decoupling of service paths from implementation.
A good example of this in action is Google's microservices demo, in particular
with the frontend service, which calls the various backend services based on an
environment-driven configuration.
Usage
Include this in your POM:
<dependency>
<groupId>com.github.brymck</groupId>
<artifactId>get-local-endpoint</artifactId>
<version>0.9.3</version>
</dependency>
And use it as so:
String fooEndpoint = getHttpEndpoint("FOO_ADDRESS");
SomeApi api = new SomeApi(fooEndpoint);