Fix the spore 'base_url' attribute
This commit is contained in:
parent
740cbea766
commit
a02b367a90
@ -205,7 +205,7 @@ class WSRoot(object):
|
|||||||
res_content_type = None
|
res_content_type = None
|
||||||
|
|
||||||
if request.path == self._webpath + '/api.spore':
|
if request.path == self._webpath + '/api.spore':
|
||||||
res.body = spore.getdesc(self)
|
res.body = spore.getdesc(self, request)
|
||||||
res.content_type = 'application/json'
|
res.content_type = 'application/json'
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ except ImportError:
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
def getdesc(root):
|
def getdesc(root, request):
|
||||||
methods = {}
|
methods = {}
|
||||||
|
|
||||||
for path, funcdef in root.getapi():
|
for path, funcdef in root.getapi():
|
||||||
@ -33,7 +33,7 @@ def getdesc(root):
|
|||||||
|
|
||||||
methods[name] = {
|
methods[name] = {
|
||||||
'method': method,
|
'method': method,
|
||||||
'path': '/'.join([root._webpath] + path)
|
'path': '/'.join(path)
|
||||||
}
|
}
|
||||||
if required_params:
|
if required_params:
|
||||||
methods[name]['required_params'] = required_params
|
methods[name]['required_params'] = required_params
|
||||||
@ -50,7 +50,7 @@ def getdesc(root):
|
|||||||
formats.append('json')
|
formats.append('json')
|
||||||
|
|
||||||
api = {
|
api = {
|
||||||
'base_url': root._webpath,
|
'base_url': request.host_url + root._webpath,
|
||||||
'version': '0.1',
|
'version': '0.1',
|
||||||
'name': getattr(root, 'name', 'name'),
|
'name': getattr(root, 'name', 'name'),
|
||||||
'authority': '',
|
'authority': '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user