update docs to handle demo and production servers as well as localhost dev.

This commit is contained in:
Keith Woodlock
2012-10-21 12:02:23 +01:00
parent 0b55ef9149
commit e8bd6ccdbd
+19 -13
View File
@@ -50,22 +50,28 @@ function clickAPILink(apiLink)
function getBaseURL(docURL)
{
var hostName = "";
if (QueryParameters["hostname"]) hostName = QueryParameters["hostname"];
else
var localhostUrl = "https://localhost:8443/mifosng-provider/api/v1/";
var openmfDemoUrl = "/mifosng-provider/api/v1/";
var baseUrl = "";
if (docURL.substring(0,4).toLowerCase() == "http")
{
if (docURL.substring(0,4).toLowerCase() == "http")
{
var l = getLocation(docURL);
hostName = l.hostname;
}
else
{
//assume running locally
hostName = "localhost";
var l = getLocation(docURL);
if (l.hostname == "demo.openmf.org") {
baseUrl = openmfDemoUrl;
} else {
baseUrl = "https://" + l.hostname + ":8443/mifosng-provider/api/v1/"
}
}
return "https://" + hostName + ":8443/mifosng-provider/api/v1/";
else
{
//assume running locally
baseUrl = localhostUrl;
}
return baseUrl;
}
</script>