diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Config.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Config.hs b/lib/Config.hs index ef90fc1..4c8e3fd 100644 --- a/lib/Config.hs +++ b/lib/Config.hs @@ -2,15 +2,17 @@ {-# LANGUAGE RecordWildCards #-} module Config (UffdConfig(..), ServerConfig(..), LoggingConfig(..)) where -import Conferer (DefaultConfig (configDef)) +import Conferer (DefaultConfig (configDef), fetch, + unsafeFetchKey) import Conferer.FromConfig import Conferer.FromConfig.Warp () import Data.ByteString (ByteString) import Data.Functor ((<&>)) import Data.Text (Text) +import qualified Data.Text as T import GHC.Generics (Generic) import Network.Wai.Handler.Warp (Settings) -import System.OsPath (OsPath, osp) +import System.OsPath (OsPath, encodeUtf, osp) import URI.ByteString data UffdConfig = UffdConfig @@ -39,6 +41,9 @@ data LoggingConfig = LoggingConfig instance FromConfig ServerConfig +instance FromConfig OsPath where + fromConfig = fetchFromConfigWith (encodeUtf . T.unpack) + instance DefaultConfig ServerConfig where configDef = ServerConfig { serverConfigWarp = configDef |