You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The need is that every path typed by the user (and that is not an existent file such as .js or .css which obviously must be downloaded by the browser) leads to the "index.html" file in the root of my static dir.
The need is that every path typed by the user (and that is not an existent file such as .js or .css which obviously must be downloaded by the browser) leads to the "index.html" file in the root of my static dir.
You can call RustEmbed::get and if the result is None then fall back to returning the index.html file.
I'm having a bit of difficulty using your example (with
axum
in this case) to host a single page application (SPA).I have no trouble without
rust-embed
using a single line of code withaxum
(from here):But I don't understand how to do with
rust-embed
.The need is that every path typed by the user (and that is not an existent file such as
.js
or.css
which obviously must be downloaded by the browser) leads to the "index.html
" file in the root of mystatic
dir.If I use your example code I can see the route:
which has
/dist/*file
and I don't need that/dist
becasue theindex.html
calls many files with custom paths, such as/_works
,menu
,images
.If I remove the
dist
part I get this error:Can you help me understand?
If I fix this I can create a PR for future people to come!
I hope my problem is clear. Sorry if is not.
The text was updated successfully, but these errors were encountered: