How to show a local image on csr mode using img tag #3108
-
I have this view and I want to display a image in it. I have placed the image on the folder [projectRoot]/public/images/test.jpg Cargo.toml:
I run the project using trunk serve --open but the image did not show up. when I navigate to http://localhost:8080/images/test.jpg, it shows "Page not found.", which is the fallback text of the Routes. Am i miss something? should there be a route for static files? if so, how? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Problem solved. It turns out that I need to add this line to index.html:
|
Beta Was this translation helpful? Give feedback.
Problem solved. It turns out that I need to add this line to index.html:
<link data-trunk rel="copy-dir" href="/public/images"/>