i use the jupyterhub to support 20users deal data in python kernels.
The jupyterhub is installed as the GitHub - jupyterhub/jupyterhub: Multi-user server for Jupyter notebooks described .
jupyterhub include jupyterlab /jupter_server/notebook/juupyter_core and so on ,i want add some functions to jupyterhub.
i want to add my own custom handlers on jupyterhub platform to deal some request from browser .
i add a new handler on the jupyter_server( v1.11.1)[GitHub - jupyter-server/jupyter_server: The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications.] in the jupyter_server\jupyter_server\services\api\handlers.py .
the add content :
class UserCustomHandler(APIHandler):
“”"
User Customization function
“”"
_track_activity = False
@web.authenticated
def get(self):
#
with open("/tmp/test.txt", 'a', encoding="utf-8") as f:
f.write("====begain run in UserCustomHandler=====")
the default handler:
default_handlers = [
(r"/api/spec.yaml", APISpecHandler),
(r"/api/status", APIStatusHandler),
(r"/api/customhandler", UserCustomHandler),
]
then i build and install the jupyter_server in my jupyterhub.
i send the request to http:ip:9000/user/lihua//api/customhandler but it does not work .
who can tell me how to add a new handler in jupyter_server of jupyterhub platform or add a new handler directly on jupyterhub source code or add a new handler on jupyterlab ?
the version information
notebook==6.4.0
jupyter-client==6.2.0
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.1
jupyter-core==4.7.1
jupyter-hdfscm==0.2.0+0.g427e8c8.dirty
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.6
jupyter-nbextensions-configurator==0.4.1
jupyter-resource-usage==0.6.0
jupyter-server==1.11.1
jupyterhub==1.0.0
jupyterhub-yarnspawner==0.4.0+2.g1c40f52.dirty
jupyterlab==3.2.1
jupyterlab-pygments==0.1.2
jupyterlab-server==2.8.2
jupyterlab-system-monitor==0.8.0
jupyterlab-topbar==0.6.1
thanks.