mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Serve API from the handlers directory
This commit is contained in:
parent
ad25d33808
commit
a690e6c059
@ -5,11 +5,12 @@
|
|||||||
|
|
||||||
from tornado import web
|
from tornado import web
|
||||||
from ...base.handlers import IPythonHandler
|
from ...base.handlers import IPythonHandler
|
||||||
|
import os
|
||||||
|
|
||||||
class APIHandler(web.StaticFileHandler, IPythonHandler):
|
class APIHandler(web.StaticFileHandler, IPythonHandler):
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
web.StaticFileHandler.initialize(self, path='')
|
web.StaticFileHandler.initialize(self, path=os.path.dirname(__file__))
|
||||||
|
|
||||||
@web.authenticated
|
@web.authenticated
|
||||||
def get(self):
|
def get(self):
|
||||||
@ -17,5 +18,5 @@ class APIHandler(web.StaticFileHandler, IPythonHandler):
|
|||||||
return web.StaticFileHandler.get(self, 'api.yaml')
|
return web.StaticFileHandler.get(self, 'api.yaml')
|
||||||
|
|
||||||
default_handlers = [
|
default_handlers = [
|
||||||
(r"/api", APIHandler),
|
(r"/api", APIHandler)
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user