I\'m starting up a Spring Boot application with mvn spring-boot:run.
One of my @Controllers needs information about the host and port the a
One solution mentioned in a reply by @M. Deinum is one that I've used in a number of Akka apps:
object Localhost {
/**
* @return String for the local hostname
*/
def hostname(): String = InetAddress.getLocalHost.getHostName
/**
* @return String for the host IP address
*/
def ip(): String = InetAddress.getLocalHost.getHostAddress
}
I've used this method when building a callback URL for Oozie REST so that Oozie could callback to my REST service and it's worked like a charm