Replies: 2 comments
-
Oh I see, I wonder how we can avoid this conflict elegantly. Serving files via Alternatively you can use @ui.page('/')
@ui.page('/two')
@ui.page('/three') instead of a catch-all route. Since it is only a simple example showing the principle of a basic router, I don't think there's anything broken or missing. If there's a simple way to avoid this issue, we can fix it. Otherwise I'd leave the example as it is. |
Beta Was this translation helpful? Give feedback.
-
Many thanks for your feedback @falkoschindler! Anyway, really cool library 👍 |
Beta Was this translation helpful? Give feedback.
-
Description
Using the default SPA example from https://github.com/zauberzeug/nicegui/tree/main/examples/single_page_app/ and adding an
ui.image()
loading an image source from the local file system does not work.Example:
Modifying the code a bit further to dump the path parameter
prints out
_nicegui/auto/static/...
.The routing of
_nicegui/auto/static/...
using a path parameter containing{_:path}
to match any path along '/
' as required for SPA seems to cause the issue here. Maybe this is somehow related to #1854Loading the image source from a different route as with
app.add_static_files("/files", ".")
or running the entire SPA from a route different from '/
' (e.g., '/home
') doesn't show this issue.Beta Was this translation helpful? Give feedback.
All reactions