aboutsummaryrefslogtreecommitdiff
path: root/lib/Config.hs
blob: c76261ee1511bfd9d63cb2fa5fd9577588461436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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/"
    }