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
As Shiny is based on Starlette, I expected it would be possible with the Mount of Starlette to provide a dynamic path, where I could recover the parameters from it. This is perfectly possible in Starlette.
Actually, the code in the first example in the link above, is very close to the code in your routing example. So I had hoped this would work, but it does not:
from shiny import App, ui
from starlette.applications import Starlette
from starlette.routing import Mount
app_home = App(
ui=ui.page_fluid("home page"),
server=None)
app_user = App(
ui=ui.page_fluid(f"user: {user_name}"), # Or something similar
server=None)
routes = [
Mount("/user/{user_name}", app=app_user),
Mount("/", app=app_home),
]
app = Starlette(routes=routes)
Actually, whatever I do, I never get a response on anything after "/user/" I always get a "Not Found" as text.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As Shiny is based on Starlette, I expected it would be possible with the Mount of Starlette to provide a dynamic path, where I could recover the parameters from it. This is perfectly possible in Starlette.
https://www.starlette.io/routing/
Actually, the code in the first example in the link above, is very close to the code in your routing example. So I had hoped this would work, but it does not:
Actually, whatever I do, I never get a response on anything after "/user/" I always get a "Not Found" as text.
Beta Was this translation helpful? Give feedback.
All reactions