diff options
author | metamuffin <metamuffin@disroot.org> | 2023-02-24 13:23:58 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-02-24 13:23:58 +0100 |
commit | 3ed98e04da0917e790063549676729c7051d67f7 (patch) | |
tree | 81fbb2c93172a7cbb284aaeed8c98d3f6a7c26b5 /src/config.rs | |
parent | c0d504f9ae77f99e5484e92e2e9d3f68561129c5 (diff) | |
download | gnix-3ed98e04da0917e790063549676729c7051d67f7.tar gnix-3ed98e04da0917e790063549676729c7051d67f7.tar.bz2 gnix-3ed98e04da0917e790063549676729c7051d67f7.tar.zst |
static file serving + bugs
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs index 210a1e6..58b885a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -22,8 +22,17 @@ pub struct HttpsConfig { } #[derive(Debug, Serialize, Deserialize)] -pub struct HostConfig { - pub backend: SocketAddr, +#[serde(untagged)] +pub enum HostConfig { + Backend { backend: SocketAddr }, + Files { files: FileserverConfig }, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FileserverConfig { + pub root: PathBuf, + #[serde(default)] + pub index: bool, } impl Config { |