From e2e6ab37983b4ce3b15a2440e433bf1f457dfd95 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 4 Oct 2017 14:12:27 +0200 Subject: [PATCH] Have yesod load correct config files when developing --- src/Application.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Application.hs b/src/Application.hs index 76d4c3480..62a9cc3c5 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -125,14 +125,14 @@ warpSettings foundation = -- | For yesod devel, return the Warp settings and WAI Application. getApplicationDev :: IO (Settings, Application) getApplicationDev = do - settings <- getAppSettings + settings <- getAppDevSettings foundation <- makeFoundation settings wsettings <- getDevSettings $ warpSettings foundation app <- makeApplication foundation return (wsettings, app) -getAppSettings :: IO AppSettings -getAppSettings = loadYamlSettings [configSettingsYml] [] useEnv +getAppDevSettings :: IO AppSettings +getAppDevSettings = loadYamlSettings [".dbsettings.yml", "config/test-settings.yml", configSettingsYml] [configSettingsYmlValue] useEnv -- | main function for use by yesod devel develMain :: IO () @@ -164,7 +164,7 @@ appMain = do -------------------------------------------------------------- getApplicationRepl :: IO (Int, App, Application) getApplicationRepl = do - settings <- getAppSettings + settings <- getAppDevSettings foundation <- makeFoundation settings wsettings <- getDevSettings $ warpSettings foundation app1 <- makeApplication foundation @@ -180,7 +180,7 @@ shutdownApp _ = return () -- | Run a handler handler :: Handler a -> IO a -handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h +handler h = getAppDevSettings >>= makeFoundation >>= flip unsafeHandler h -- | Run DB queries db :: ReaderT SqlBackend (HandlerT App IO) a -> IO a