aboutsummaryrefslogtreecommitdiff
path: root/lib/Config.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Config.hs')
-rw-r--r--lib/Config.hs28
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/"
+ }