diff options
author | stuebinm | 2022-08-28 21:33:33 +0200 |
---|---|---|
committer | stuebinm | 2022-08-28 21:34:54 +0200 |
commit | f7066888652ed3326017adf2eb6786a21043ebf5 (patch) | |
tree | 82b14b74bd352b553eb4036f48b15d3a2c4cae37 /lib/Config.hs | |
parent | 1b2e30c134c996e82c282b21099f21501dd966ac (diff) |
some config thingyesod
works kinda well, but doesn't complain about unknown config values in
json, which is kinda hmpf tbh
Diffstat (limited to '')
-rw-r--r-- | lib/Config.hs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/Config.hs b/lib/Config.hs new file mode 100644 index 0000000..c76261e --- /dev/null +++ b/lib/Config.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE DeriveGeneric #-} +-- | + +module Config where +import Conferer (DefaultConfig (configDef), + FromConfig) +import Conferer.FromConfig.Warp () +import Data.ByteString (ByteString) +import Data.Text (Text) +import GHC.Generics (Generic) +import Network.Wai.Handler.Warp (Settings) + +data ServerConfig = ServerConfig + { serverConfigWarp :: Settings + , serverConfigDbString :: ByteString + , serverConfigGtfs :: FilePath + , serverConfigZoneinfoPath :: FilePath + } deriving Generic + +instance FromConfig ServerConfig + +instance DefaultConfig ServerConfig where + configDef = ServerConfig + { serverConfigWarp = configDef + , serverConfigDbString = "" + , serverConfigGtfs = "./gtfs.zip" + , serverConfigZoneinfoPath = "/etc/zoneinfo/" + } |