pub struct StaticConfig {
pub dir: Option<PathBuf>,
pub mount: Option<String>,
pub spa: bool,
pub cache_control: Option<String>,
pub dotfiles: bool,
}Expand description
Static file serving ([static] section): a GET or HEAD under
mount that no route serves with that method is answered from dir
entirely in Rust, without a Lua state. Scripts can add further mounts
with app:static(mount, dir, opts?).
Fields§
§dir: Option<PathBuf>Directory served as static files; unset disables the section.
mount: Option<String>URL prefix the directory is mounted at (default /).
spa: boolServe index.html for unknown paths (single-page applications).
cache_control: Option<String>Cache-Control header value for served files.
dotfiles: boolServe files and directories whose name starts with . (default
false). .well-known/ is served regardless.
Trait Implementations§
Source§impl Clone for StaticConfig
impl Clone for StaticConfig
Source§impl Debug for StaticConfig
impl Debug for StaticConfig
Source§impl Default for StaticConfig
impl Default for StaticConfig
Source§impl<'de> Deserialize<'de> for StaticConfigwhere
StaticConfig: Default,
impl<'de> Deserialize<'de> for StaticConfigwhere
StaticConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StaticConfig
impl RefUnwindSafe for StaticConfig
impl Send for StaticConfig
impl Sync for StaticConfig
impl Unpin for StaticConfig
impl UnsafeUnpin for StaticConfig
impl UnwindSafe for StaticConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more