update apidocs to default (for live examples) to host it is running on
This commit is contained in:
+28
-2
@@ -8,12 +8,19 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
baseURL = "https://ec2-46-137-62-163.eu-west-1.compute.amazonaws.com:8443/mifosng-provider/api/v1/";
|
var getLocation = function(href) {
|
||||||
//baseURL = "https://localhost:8443/mifosng-provider/api/v1/";
|
var l = document.createElement("a");
|
||||||
|
l.href = href;
|
||||||
|
return l;
|
||||||
|
};
|
||||||
|
|
||||||
|
baseURL = "";
|
||||||
defQueryParams = "tenantIdentifier=default&pretty=true";
|
defQueryParams = "tenantIdentifier=default&pretty=true";
|
||||||
|
|
||||||
function clickAPILink(apiLink)
|
function clickAPILink(apiLink)
|
||||||
{
|
{
|
||||||
|
if (baseURL == "") baseURL = getBaseURL(window.location.href);
|
||||||
|
|
||||||
var currentLink = baseURL + apiLink;
|
var currentLink = baseURL + apiLink;
|
||||||
if (apiLink.indexOf("?") < 0) currentLink += "?" + defQueryParams;
|
if (apiLink.indexOf("?") < 0) currentLink += "?" + defQueryParams;
|
||||||
else currentLink += "&" + defQueryParams;
|
else currentLink += "&" + defQueryParams;
|
||||||
@@ -21,6 +28,25 @@ function clickAPILink(apiLink)
|
|||||||
//alert(currentLink);
|
//alert(currentLink);
|
||||||
location.href = currentLink;
|
location.href = currentLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getBaseURL(docURL)
|
||||||
|
{
|
||||||
|
var hostName = ""
|
||||||
|
if (docURL.substring(0,4).toLowerCase() == "http")
|
||||||
|
{
|
||||||
|
var l = getLocation(docURL);
|
||||||
|
hostName = l.hostname;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//assume running locally
|
||||||
|
hostName = "localhost";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "https://" + hostName + ":8443/mifosng-provider/api/v1/";
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user