Read CLIENT and SERVER endpoints from .envrc
In the spirit of DRY.
This commit is contained in:
parent
1d7c77f51d
commit
c8ed6e51fe
2 changed files with 24 additions and 19 deletions
|
|
@ -33,12 +33,16 @@ import qualified Data.UUID as UUID
|
|||
data Config = Config
|
||||
{ mailgunAPIKey :: Text
|
||||
, dbFile :: FilePath
|
||||
, configClient :: Text
|
||||
, configServer :: Text
|
||||
} deriving (Eq, Show)
|
||||
|
||||
instance FromEnv Config where
|
||||
fromEnv _ = do
|
||||
mailgunAPIKey <- env "MAILGUN_API_KEY"
|
||||
dbFile <- env "DB_FILE"
|
||||
configClient <- env "CLIENT"
|
||||
configServer <- env "SERVER"
|
||||
pure Config {..}
|
||||
|
||||
-- TODO(wpcarro): Properly handle NULL for columns like profilePicture.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue