def main():
    """Launch a jupyterhub single-user server"""
    if not os.environ.get("JUPYTERHUB_SINGLEUSER_APP"):
        # app not specified, launch jupyter-labhub by default,
        # if jupyterlab is recent enough (3.1).
        # This is a minimally extended ServerApp that does:
        # 1. ensure lab extension is enabled, and
        # 2. set default URL to `/lab`
        import re

        _version_pat = re.compile(r"(\d+)\.(\d+)")
        try:
            import jupyterlab
            from jupyterlab.labhubapp import SingleUserLabApp

            m = _version_pat.match(jupyterlab.__version__)
        except Exception:
            m = None

        if m is not None:
            version_tuple = tuple(int(v) for v in m.groups())
            if version_tuple >= (3, 1):
                return SingleUserLabApp.launch_instance()

    if JUPYVERSE:
        from fps_auth_jupyterhub import launch

        return launch()

    return SingleUserNotebookApp.launch_instance()
Launch a jupyterhub single-user server
jupyterhub/singleuser/app.py