Closed MalloryWittwer closed 1 month ago
Hi, can you try to use the PORT variable, like in this example:
- title: Streamlit example
description: Example of opening a streamlit app
source: http://localhost:$PORT/
cwd: ./
type: local-server
args:
- streamlit
- run
- st_app.py
- --server.headless=true
- --server.port=$PORT
catalog: Another catalog
jupyter_app_launcher
will define this variable and do the routing job
Thank you, indeed using the $PORT variable seems to have solved my problem. For the record, the modified code is:
- title: Render HTML website
source: http://localhost:$PORT/
type: local-server
catalog: Commands
args:
- python3
- -m
- http.server
- '$PORT'
- --directory=/home/jovyan/src/_build/html/
- --bind=127.0.0.1
Hello,
I would like to create a launcher entry to render a locally-built website in a Jupyterlab tab. I'm working with a JupyterHub that spawns user sessions in separate docker containers. Each user has an
index.html
file saved in their session. My goal is for them to be able to render thisindex.html
file in a jupyter lab tab by clicking on a launch button.Below are my two attempts at setting up the
jp_app_launcher.yaml
, either using a url or via a local-server type:The first option (url) doesn't work because the browser isn't allowed to render local files, as I understand it. The second option (local-server) seems more promising. The command
python -m http.server
works; the process appears in the "Launcher Application" list, the web server is running, andcurl http://localhost:9000/
returns indeed the correct HTML (command sent from the user's session, so inside the docker container).Despite that, the launcher still throws a
500 - Internal Server Error
when opening a new jupyter tab. Looking in the logs, I also see aConnectionRefusedError: [Errno 111] Connection refused
error.Any help would be appreciated. Thank you very much!