Skip to content

Handling dynamic pages at runtime #117

Answered by ElMassimo
dantownsend asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Daniel! @dantownsend

Like with any single-page application, you need to ensure requests to nested paths are served the main HTML file, which will then takeover and render the appropriate page.

In this case, you would want the app.html file to be served for any request such as /app/project/some-uuid. The specific configuration will depend on how you are hosting your app, for example in Netlify:

/app/* /app.html 200

For development, you could add middleware to the Vite dev server to do the same (Vite automatically serves index.html for nested requests, but in this case you'll have to configure that manually since it's a different path).


In terms of how to implement it, you have a few o…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@gilesbutler
Comment options

@ElMassimo
Comment options

@gilesbutler
Comment options

@ElMassimo
Comment options

@gilesbutler
Comment options

Answer selected by ElMassimo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants