Skip to content

Commit 07a546d

Browse files
committed
Diego migration fix
1 parent c99c7b1 commit 07a546d

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

server.js

+5-11
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,11 @@ var port = process.env.VCAP_APP_PORT || 8081;
104104
var connected = function () {
105105
console.log("CDS Labs Metrics Collector Microservice started on port %s : %s", port, Date(Date.now()));
106106
};
107-
var url = null;
108-
109-
if (process.env.VCAP_APP_HOST) {
110-
http.listen(process.env.VCAP_APP_PORT,
111-
process.env.VCAP_APP_HOST,
112-
connected);
113-
url = appEnv.url + '/tracker';
114-
} else {
115-
http.listen(port, connected);
116-
url = 'http://localhost:' + port + '/tracker';
117-
}
107+
var url = appEnv.url + "/tracker";
108+
109+
http.listen(appEnv.port, ( appEnv.bind == "localhost" ? null : appEnv.bind ), () => {
110+
console.log(`CDS Labs Metrics Collector Microservice listening on ${appEnv.url}`);
111+
});
118112

119113
// if we detect etcd
120114
if (process.env.ETCD_URL) {

0 commit comments

Comments
 (0)