never mind 80, just don't show port in PRODUCTION

Works when you don't deploy to port 80
This commit is contained in:
Greg Weber 2011-09-01 08:37:42 -07:00
parent e6bab578fc
commit 1e98a69319
2 changed files with 14 additions and 8 deletions

View File

@ -91,13 +91,16 @@ loadConfig env = do
return $ AppConfig {
appEnv = env
, appPort = port
, appRoot = pack $ hostS ++ maybeAddPort port
, appRoot = pack $ hostS ++ addPort port
, connectionPoolSize = read connectionPoolSizeS
}
where
maybeAddPort :: Int -> String
maybeAddPort 80 = ""
maybeAddPort p = ":" ++ (show p)
addPort :: Int -> String
#ifdef PRODUCTION
addPort _ = ""
#else
addPort p = ":" ++ (show p)
#endif
-- Static setting below. Changing these requires a recompile

View File

@ -72,12 +72,15 @@ loadConfig env = do
return $ AppConfig {
appEnv = env
, appPort = port
, appRoot = pack $ hostS ++ maybeAddPort port
, appRoot = pack $ hostS ++ addPort port
}
where
maybeAddPort :: Int -> String
maybeAddPort 80 = ""
maybeAddPort p = ":" ++ (show p)
addPort :: Int -> String
#ifdef PRODUCTION
addPort _ = ""
#else
addPort p = ":" ++ (show p)
#endif
-- | The location of static files on your system. This is a file system
-- path. The default value works properly with your scaffolded site.