From 3ed98e04da0917e790063549676729c7051d67f7 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 24 Feb 2023 13:23:58 +0100 Subject: static file serving + bugs --- src/config.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/config.rs') 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 { -- cgit v1.2.3-70-g09d2