diff options
Diffstat (limited to 'Settings.hs')
-rw-r--r-- | Settings.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Settings.hs b/Settings.hs index a15fb03..8a98c7a 100644 --- a/Settings.hs +++ b/Settings.hs | |||
@@ -35,6 +35,7 @@ data AppSettings = AppSettings | |||
35 | -- ^ Directory from which to serve static files. | 35 | -- ^ Directory from which to serve static files. |
36 | , appDatabaseConf :: PostgresConf | 36 | , appDatabaseConf :: PostgresConf |
37 | -- ^ Configuration settings for accessing the database. | 37 | -- ^ Configuration settings for accessing the database. |
38 | , appRoot :: Maybe Text | ||
38 | , appHost :: HostPreference | 39 | , appHost :: HostPreference |
39 | -- ^ Host/interface the server should bind to. | 40 | -- ^ Host/interface the server should bind to. |
40 | , appPort :: Int | 41 | , appPort :: Int |
@@ -59,6 +60,11 @@ instance FromJSON AppSettings where | |||
59 | parseUrl' = either (fail . show) return . parseBaseUrl | 60 | parseUrl' = either (fail . show) return . parseBaseUrl |
60 | appStaticDir <- o .: "static-dir" | 61 | appStaticDir <- o .: "static-dir" |
61 | appDatabaseConf <- o .: "database" | 62 | appDatabaseConf <- o .: "database" |
63 | appRoot' <- o .:? "approot" | ||
64 | let | ||
65 | appRoot | ||
66 | | appRoot' == Just "" = Nothing | ||
67 | | otherwise = appRoot' | ||
62 | appHost <- fromString <$> o .: "host" | 68 | appHost <- fromString <$> o .: "host" |
63 | appPort <- o .: "port" | 69 | appPort <- o .: "port" |
64 | appIpFromHeader <- o .: "ip-from-header" | 70 | appIpFromHeader <- o .: "ip-from-header" |