Last active
January 23, 2016 18:39
-
-
Save kylekyle/9117d48224b0f4a82d23 to your computer and use it in GitHub Desktop.
Return a health monitoring status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' Add to jupyter_notebook_config.py | |
import sys | |
sys.path.append("/root/.jupyter/extensions/") | |
c.NotebookApp.reraise_server_extension_failures = True | |
c.NotebookApp.server_extensions = ['status'] | |
''' | |
from notebook.utils import url_path_join | |
from notebook.base.handlers import IPythonHandler | |
class Status(IPythonHandler): | |
def get(self): | |
self.finish("I'm alive and well, thank you very much.") | |
def load_jupyter_server_extension(app): | |
web_app = app.web_app | |
host_pattern = '.*$' | |
route_pattern = url_path_join(web_app.settings['base_url'], '/v1/status') | |
web_app.add_handlers(host_pattern, [(route_pattern, Status)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment