You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
689 B
24 lines
689 B
"""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
|
|
import os
|
|
|
|
class APISpecHandler(web.StaticFileHandler, IPythonHandler):
|
|
|
|
def initialize(self):
|
|
web.StaticFileHandler.initialize(self, path=os.path.dirname(__file__))
|
|
|
|
@web.authenticated
|
|
def get(self):
|
|
self.log.warning("Serving api spec (experimental, incomplete)")
|
|
self.set_header('Content-Type', 'text/x-yaml')
|
|
return web.StaticFileHandler.get(self, 'api.yaml')
|
|
|
|
default_handlers = [
|
|
(r"/api/spec.yaml", APISpecHandler)
|
|
]
|