mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Add an api discovery url
This commit is contained in:
parent
19c6905769
commit
ad25d33808
@ -228,6 +228,7 @@ class NotebookWebApplication(web.Application):
|
|||||||
handlers.extend(load_handlers('nbconvert.handlers'))
|
handlers.extend(load_handlers('nbconvert.handlers'))
|
||||||
handlers.extend(load_handlers('kernelspecs.handlers'))
|
handlers.extend(load_handlers('kernelspecs.handlers'))
|
||||||
handlers.extend(load_handlers('edit.handlers'))
|
handlers.extend(load_handlers('edit.handlers'))
|
||||||
|
handlers.extend(load_handlers('services.api.handlers'))
|
||||||
handlers.extend(load_handlers('services.config.handlers'))
|
handlers.extend(load_handlers('services.config.handlers'))
|
||||||
handlers.extend(load_handlers('services.kernels.handlers'))
|
handlers.extend(load_handlers('services.kernels.handlers'))
|
||||||
handlers.extend(load_handlers('services.contents.handlers'))
|
handlers.extend(load_handlers('services.contents.handlers'))
|
||||||
|
0
notebook/services/api/__init__.py
Normal file
0
notebook/services/api/__init__.py
Normal file
21
notebook/services/api/handlers.py
Normal file
21
notebook/services/api/handlers.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
"""Tornado handlers for api specifications."""
|
||||||
|
|
||||||
|
# Copyright (c) Jupyter Development Team.
|
||||||
|
# Distributed under the terms of the Modified BSD License.
|
||||||
|
|
||||||
|
from tornado import web
|
||||||
|
from ...base.handlers import IPythonHandler
|
||||||
|
|
||||||
|
class APIHandler(web.StaticFileHandler, IPythonHandler):
|
||||||
|
|
||||||
|
def initialize(self):
|
||||||
|
web.StaticFileHandler.initialize(self, path='')
|
||||||
|
|
||||||
|
@web.authenticated
|
||||||
|
def get(self):
|
||||||
|
self.log.debug("Serving api")
|
||||||
|
return web.StaticFileHandler.get(self, 'api.yaml')
|
||||||
|
|
||||||
|
default_handlers = [
|
||||||
|
(r"/api", APIHandler),
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user