mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-22 01:23:43 +00:00
Fixed Web API to work with new tornado code!
This commit is contained in:
parent
500f387bad
commit
088e32b117
2 changed files with 6 additions and 1 deletions
|
@ -177,7 +177,12 @@ class IndexHandler(RedirectHandler):
|
||||||
"""
|
"""
|
||||||
args = None
|
args = None
|
||||||
path = self.request.uri.split('?')[0]
|
path = self.request.uri.split('?')[0]
|
||||||
|
|
||||||
method = path.strip('/').split('/')[-1]
|
method = path.strip('/').split('/')[-1]
|
||||||
|
if path.startswith('/api'):
|
||||||
|
apikey = path.strip('/').split('/')[-1]
|
||||||
|
method = path.strip('/').split('/')[0]
|
||||||
|
self.request.arguments.update({'apikey':[apikey]})
|
||||||
|
|
||||||
def pred(c):
|
def pred(c):
|
||||||
return inspect.isclass(c) and c.__module__ == pred.__module__
|
return inspect.isclass(c) and c.__module__ == pred.__module__
|
||||||
|
|
|
@ -107,7 +107,7 @@ def initWebServer(options={}):
|
||||||
app.add_handlers(".*$", [
|
app.add_handlers(".*$", [
|
||||||
(r"/", RedirectHandler, {'url': '/home/'}),
|
(r"/", RedirectHandler, {'url': '/home/'}),
|
||||||
(r'/login', webserve.LoginHandler),
|
(r'/login', webserve.LoginHandler),
|
||||||
(r'/api', webapi.Api),
|
(r'/api/(.*)(/?)', webapi.Api),
|
||||||
(r'%s(.*)(/?)' % options['web_root'], webserve.IndexHandler)
|
(r'%s(.*)(/?)' % options['web_root'], webserve.IndexHandler)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue