Serve API from the handlers directory

This commit is contained in:
Jason Grout 2015-06-26 20:01:18 +00:00
parent ad25d33808
commit a690e6c059
2 changed files with 3 additions and 2 deletions

View File

@ -5,11 +5,12 @@
from tornado import web
from ...base.handlers import IPythonHandler
import os
class APIHandler(web.StaticFileHandler, IPythonHandler):
def initialize(self):
web.StaticFileHandler.initialize(self, path='')
web.StaticFileHandler.initialize(self, path=os.path.dirname(__file__))
@web.authenticated
def get(self):
@ -17,5 +18,5 @@ class APIHandler(web.StaticFileHandler, IPythonHandler):
return web.StaticFileHandler.get(self, 'api.yaml')
default_handlers = [
(r"/api", APIHandler),
(r"/api", APIHandler)
]