Load the new settings

master
rnhmjoj 2015-04-10 23:25:52 +02:00
parent dd91af6b39
commit 492edca20d
2 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
module Application where
import Breve.Common
@ -21,9 +21,9 @@ logStr = liftIO . putStrLn
app :: (Application -> IO ()) -> IO ()
app runner = do
settings <- newAppSettings
(baseUrl,_) <- serverSettings
table <- records
settings <- newAppSettings
ServerSettings {..} <- newServerSettings
table <- load urlTable
css <- getDataFileName "layouts/main.css"
index <- getDataFileName "views/index.html"

View File

@ -1,4 +1,4 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
import Application
import Breve.Common
@ -9,6 +9,6 @@ import Network.Wai.Middleware.RequestLogger
main :: IO ()
main = do
(url, settings) <- serverSettings
putStrLn ("Serving on " ++ url)
app (runSettings settings . logStdout)
ServerSettings {..} <- newServerSettings
putStrLn ("Serving on " ++ bindUrl)
app (runSettings warpSettings . logStdout)