You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
App.run() does not serve a mounted ASGI app (routes=[Mount(...)]) that works with uvicorn.run(app) #1568
Hi, I want to update my virtual observatory app (https://specsy.streamlit.app/) so that the user can download data selections from a Bokeh figure.
I have managed to get a working version by embedding a Bokeh server app (Bokeh 3.10 BokehASGI) in the Streamlit app via st.App(..., routes=[Mount("/bokeh", app=bokeh_app)]). When I serve the st.App with uvicorn.run(app), the mounted app works: the Bokeh page renders and its websocket callbacks run. When I start the same object with app.run(), the mounted route returns a blank white page.
Is mounting ASGI sub-applications via routes meant to be supported by App.run() and by streamlit run for st.App scripts? The App.run() docstring says it "reuses the same embedded ASGI server runner that streamlit run uses for st.App scripts".
The reason I am asking is that Streamlit Community Cloud launches apps with streamlit run, so I cannot use uvicorn.run(app) there. I would like a uniform Streamlit app for both the online and the offline installation.
python app.py --uvicorn and open http://localhost:8501/bokeh/app: "Hello from Bokeh" is shown, and the iframe in the Streamlit page also shows it.
python app.py and open the same URL: blank white page, and the iframe in the Streamlit page is empty.
Expected behaviour
app.run() serves the routes passed to st.App(routes=...), including mounted ASGI apps with websockets, the same way uvicorn.run(app) does. I'd expect the same behaviour with streamlit run app.py.
Activity