killbill-uncached

Merge pull request #246 from kares/patch-1 improve current

12/16/2014 3:09:10 PM

Details

diff --git a/profiles/killbill/src/main/webapp/api.html b/profiles/killbill/src/main/webapp/api.html
index 0ce3e81..8cd886f 100644
--- a/profiles/killbill/src/main/webapp/api.html
+++ b/profiles/killbill/src/main/webapp/api.html
@@ -43,14 +43,9 @@
   <script src='lib/swagger-oauth.js' type='text/javascript'></script>
   <script type="text/javascript">
     $(function () {
-      var url = window.location.search.match(/url=([^&]+)/);
-      if (url && url.length > 1) {
-        url = url[1];
-      } else {
-        url = "http://127.0.0.1:8080/api-docs";
-      }
+      var url = window.location.href.replace(/(.*)(\/[^\/]*?)$/, '$1/api-docs')
       window.swaggerUi = new SwaggerUi({
-        url: url,
+        url: (url || "http://127.0.0.1:8080/api-docs"),
         dom_id: "swagger-ui-container",
         supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
         onComplete: function(swaggerApi, swaggerUi){