don't just get the default host for every connect option.

This commit is contained in:
Adam C. Baker
2014-07-06 20:12:23 -07:00
parent 91efcba6e9
commit 53d90987ff
+2 -2
View File
@@ -53,8 +53,8 @@ connInfo config = defaultConnectInfo {
}
where
opts = parseDatabaseUrl $ configDb config
fromOpt key = maybe (connectHost defaultConnectInfo) unpack $ lookup key opts
[host, user, pass, db] = map fromOpt ["host", "user", "password", "dbname"]
fromOpt (fn, key) = maybe (fn defaultConnectInfo) unpack $ lookup key opts
[host, user, pass, db] = map fromOpt [(connectHost, "host"), (connectUser, "user"), (connectPassword, "password"), (connectDatabase, "dbname")]
app :: AppConfig -> Application
app config req respond =