Skip to content

Commit

Permalink
better defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
zachary822 committed Nov 15, 2023
1 parent edb0ec3 commit 376e222
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Data.Functor ((<&>))
import Data.List (intersperse)
import Data.Maybe
import Data.Pool
import Data.String (fromString)
import Data.Text (Text)
import Data.Text qualified as T
import Database.MongoDB
Expand Down Expand Up @@ -70,6 +71,8 @@ main = do
debug <- isDebug

dburi <- getEnv "MONGODB_URI"
webHost <- fromMaybe "localhost" <$> lookupEnv "HOST"
webPort <- fromMaybe "3000" <$> lookupEnv "PORT"

let (dbhost, uname, passwd) = getDbInfo dburi

Expand All @@ -81,7 +84,7 @@ main = do
defaultOptions
{ verbose = 1
, settings =
setHost "localhost" . setPort 3000 $
setHost (fromString webHost) . setPort (read webPort) $
settings defaultOptions
}

Expand Down

0 comments on commit 376e222

Please sign in to comment.