Handling dynamic pages at runtime #117
-
Hi, I recently came across this project and think it's amazing. Most of my apps have a structure similar to this:
Most of the pages fit in with the Iles model really well - they're mostly static, with a bit of interactivity. However, everything under I can work around this by using GET params, so rather than having Is there any other guidance you can provide on this? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
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
For development, you could add middleware to the Vite dev server to do the same (Vite automatically serves In terms of how to implement it, you have a few options:
If you share an example repo I'd be happy to show you how you might apply these techniques 😃 An alternative that you can use if the interactive pages are not conceptually "the same site", is to use a subdomain to host a separate Vite app, such as |
Beta Was this translation helpful? Give feedback.
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: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…