Hello,
I recently deployed a 'multi-page' dash app to a Posit Connect Server at my organization. I understand that only the 'index' page is served at the vanity url and other pages will be accessible through .../content/{GUID}/page-name
as per the documentation available at: Posit Connect Documentation Version 2024.05.0 - Dash
But in my case, the index page i.e. home page is not served automatically on the vanity url. But instead I have to click on the 'link for home page' and then it renders the home page.
This is how home page is setup:
dash.register_page(
__name__,
name = 'Home',
path='/',
order=0
)
and this is how the 'page buttons and corresponding links' are defined in the entrypoint app.py file:
# Page buttons and links
dbc.Row([
dbc.Col(
children=[dcc.Link(page['name'], href=page["relative_path"], className="button")],
align="center", style={"font-size":"36px"}
) for page in dash.page_registry.values()
], justify="end")
When the app launches on Posit Connect server, as I mentioned, it doesn't load the home page and throws the following exception. The home page only loads up when the 'Home' button is clicked.
dash.exceptions.UnsupportedRelativePath: Paths that aren't prefixed with requests_pathname_prefix are not supported. You supplied: /vanity_url/ and requests_pathname_prefix was /content/{GUID}/
So, how can I make sure the home page loads up when the user navigates to the location https://posit-connect-server/vanity_url/
? For user navigating to other pages, I do not have a problem with the url changing to https://posit-connect-server/content/{GUID}/page-name/
.