diff --git a/examples/service-announcement/README.md b/examples/service-announcement/README.md index 0582facc..6e31e8e5 100644 --- a/examples/service-announcement/README.md +++ b/examples/service-announcement/README.md @@ -6,12 +6,29 @@ that appear when JupyterHub renders pages. To run the service as a hub-managed service simply include in your JupyterHub configuration file something like: +:notebook:**Info**: You can run the announcement service example from the `examples` + directory, using one of the several services provided by JupyterHub. + + ```python + +import sys + +from pathlib import Path +# absolute path to announcement.py +announcement_py = str(Path(__file__).parent.joinpath("announcement.py").resolve()) + +#ensure get_config() is added to in + c = get_config() + +... +.. + c.JupyterHub.services = [ { 'name': 'announcement', 'url': 'http://127.0.0.1:8888', - 'command': [sys.executable, "-m", "announcement", "--port", "8888"], + 'command': [sys.executable, announcement_py, "--port", "8888"], } ] ``` diff --git a/examples/service-announcement/jupyterhub_config.py b/examples/service-announcement/jupyterhub_config.py index 9bca9809..07a9fe76 100644 --- a/examples/service-announcement/jupyterhub_config.py +++ b/examples/service-announcement/jupyterhub_config.py @@ -1,5 +1,7 @@ import sys +c = get_config() + # To run the announcement service managed by the hub, add this. port = 9999