diff --git a/README.md b/README.md index 9ec1ebf..6c0c9a7 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,8 @@ In the above example the application would be accessible at the following addres Note: the `registrationNetworkInterfacePriority` property allows the selection of the network interface when dynamically registering a service with ZooKeeper. +Note: if `registrationNetworkInterfacePriority` dont works for you you can set `ADVERTISED_HOST` enviroment variable. + If you would like to override the version which is exposed in the /info endpoint, just set the VERSION node env variable. ```sh diff --git a/lib/zoologist.js b/lib/zoologist.js index 533a9dd..8c463ae 100644 --- a/lib/zoologist.js +++ b/lib/zoologist.js @@ -67,7 +67,7 @@ ZoologistConfig.prototype.initialise = function(options) { self.serviceInstance = ServiceInstanceBuilder .builder() - .address(self.getIpAddress()) + .address(process.env.ADVERTISED_HOST ||self.getIpAddress()) .port(process.env.PORT || options.server.port) .name(options.serviceName) .build(); diff --git a/package-lock.json b/package-lock.json index b7ff2d0..3dca0d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "express-microservice-starter", - "version": "0.6.6", + "version": "0.6.9", "lockfileVersion": 1, "requires": true, "dependencies": {