This plugin allows services to get the path to a static folder at runtime
Add shuttle-static-folder
to the dependencies for your service. This resource can be using by the shuttle_static_folder::StaticFolder
attribute to get a PathBuf
with the location of the static folder.
An example using the Axum framework can be found on GitHub
``` rust
async fn main( #[shuttlestaticfolder::StaticFolder] staticfolder: PathBuf, ) -> _ { ... } ```
| Parameter | Type | Default | Description |
|-----------|------|----------|--------------------------------------------------------------------|
| folder | str | static
| The relative path, from the crate root, to the directory containing static files to deploy |
Since this plugin defaults to the static
folder, the arguments can be used to use the public
folder instead.
``` rust
async fn main( #[shuttlestaticfolder::StaticFolder(folder = "public")] publicfolder: PathBuf, ) -> _ { ... } ```