diff options
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 { |