aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs13
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 {