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
I encountered an issue serving a static HTML template after deploying it with Docker containerization and I think that the documentation is a bit unclear.
Let me quote it first
In the example above, /static is an absolute path. If your static files are stored relative to your crate and your project is managed by Rocket, use the relative! macro to obtain a path that is relative to your crate’s root.
Actually relative!("static") seems to produce an absolute path out of the relative one, so finally I had to omit the relative! even though it was counter-intuitive.
System Checks
I confirmed that the issue still exists on master on GitHub.
I was unable to find a previous report of this problem.
The text was updated successfully, but these errors were encountered:
As I noted here, this comment of @blackghost1987 should be included in the documentation:
The relative! macro has a confusing name. If you want your binary to find the static dir relative to your binary (so you can deploy it anywhere) then you should get rid of relative!, because it would bake in the absolute path. Just use something like FileServer::from("static"), it should work fine.
What kind of documentation problem are you reporting?
Unclear Docs
Where is the issue found?
https://api.rocket.rs/v0.5/rocket/fs/struct.FileServer#relative-paths
What's wrong?
I encountered an issue serving a static HTML template after deploying it with Docker containerization and I think that the documentation is a bit unclear.
Let me quote it first
Actually
relative!("static")
seems to produce an absolute path out of the relative one, so finally I had to omit therelative!
even though it was counter-intuitive.System Checks
master
on GitHub.The text was updated successfully, but these errors were encountered: