Skip to content

Instantly share code, notes, and snippets.

@garethahealy
Created January 25, 2017 16:22
Show Gist options
  • Save garethahealy/ef349033b588c31d3d1107504ba82129 to your computer and use it in GitHub Desktop.
Save garethahealy/ef349033b588c31d3d1107504ba82129 to your computer and use it in GitHub Desktop.
metrics-isAvailable
$http = angular.element(document.body).injector().get('$http');
var isAvailable = function() {
var url = _.get(window.OPENSHIFT_CONFIG, "metricsURL");
console.log("Trying to check for " + url);
if (!url) {
return false;
}
return $http.get(url).then(function() {
connectionSucceeded = true;
console.log("Made connection to " + url);
return true;
}, function(response) {
return false;
});
};
isAvailable();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment