mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 10:04:07 +00:00
modified announcement README and config.py
This commit is contained in:
@@ -6,12 +6,29 @@ that appear when JupyterHub renders pages.
|
|||||||
To run the service as a hub-managed service simply include in your JupyterHub
|
To run the service as a hub-managed service simply include in your JupyterHub
|
||||||
configuration file something like:
|
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
|
```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 = [
|
c.JupyterHub.services = [
|
||||||
{
|
{
|
||||||
'name': 'announcement',
|
'name': 'announcement',
|
||||||
'url': 'http://127.0.0.1:8888',
|
'url': 'http://127.0.0.1:8888',
|
||||||
'command': [sys.executable, "-m", "announcement", "--port", "8888"],
|
'command': [sys.executable, announcement_py, "--port", "8888"],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
c = get_config()
|
||||||
|
|
||||||
# To run the announcement service managed by the hub, add this.
|
# To run the announcement service managed by the hub, add this.
|
||||||
|
|
||||||
port = 9999
|
port = 9999
|
||||||
|
Reference in New Issue
Block a user