diff --git a/wsme/root.py b/wsme/root.py index b0d9d2f..91a0106 100644 --- a/wsme/root.py +++ b/wsme/root.py @@ -205,7 +205,7 @@ class WSRoot(object): res_content_type = None if request.path == self._webpath + '/api.spore': - res.body = spore.getdesc(self) + res.body = spore.getdesc(self, request) res.content_type = 'application/json' return res diff --git a/wsme/spore.py b/wsme/spore.py index b45554c..e481bf6 100644 --- a/wsme/spore.py +++ b/wsme/spore.py @@ -6,7 +6,7 @@ except ImportError: import json -def getdesc(root): +def getdesc(root, request): methods = {} for path, funcdef in root.getapi(): @@ -33,7 +33,7 @@ def getdesc(root): methods[name] = { 'method': method, - 'path': '/'.join([root._webpath] + path) + 'path': '/'.join(path) } if required_params: methods[name]['required_params'] = required_params @@ -50,7 +50,7 @@ def getdesc(root): formats.append('json') api = { - 'base_url': root._webpath, + 'base_url': request.host_url + root._webpath, 'version': '0.1', 'name': getattr(root, 'name', 'name'), 'authority': '',