8000 Serving static files · Issue #2866 · rwf2/Rocket · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Serving static files #2866
Open
Open
@giuliohome

Description

@giuliohome

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0