remove old TODO

This commit is contained in:
Greg Weber 2011-12-25 22:27:57 -03:00
parent 630124149a
commit 00cf9f2953
8 changed files with 23 additions and 23 deletions

View File

@ -60,9 +60,6 @@ defaultMain load withSite = do
-- > Settings.withConnectionPool conf $ \p -> do
-- > runConnectionPool (runMigration yourMigration) p
-- > defaultRunner f $ YourSite conf logger p
--
-- TODO: ifdef WINDOWS
--
defaultRunner :: (YesodDispatch y y, Yesod y)
=> (Application -> IO a)
-> y -- ^ your foundation type

View File

@ -6,7 +6,7 @@ module Application
import Import
import Settings
import Yesod.Static
import Settings.StaticFiles (staticSite)
import Yesod.Auth
import Yesod.Default.Config
import Yesod.Default.Main
@ -29,11 +29,7 @@ mkYesodDispatch "~sitearg~" resources~sitearg~
-- migrations handled by Yesod.
with~sitearg~ :: AppConfig DefaultEnv () -> Logger -> (Application -> IO ()) -> IO ()
with~sitearg~ conf logger f = do
#ifdef DEVELOPMENT
s <- staticDevel Settings.staticDir
#else
s <- static Settings.staticDir
#endif
s <- staticSite
dbconf <- withYamlEnvironment "config/~dbConfigFile~.yml" (appEnv conf)
$ either error return . Database.Persist.Base.loadConfig
Database.Persist.Base.withPool (dbconf :: Settings.PersistConfig) $ \p -> do~runMigration~

View File

@ -1,10 +1,21 @@
module Settings.StaticFiles where
import Yesod.Static (staticFiles, StaticRoute (StaticRoute))
import qualified Yesod.Static as Static
import Settings (staticDir)
-- | This generates easy references to files in the static directory at compile time.
-- The upside to this is that you have compile-time verification that referenced files
-- exist. However, any files added to your static directory during run-time can't be
-- | use this to create your static file serving site
staticSite :: IO Static
staticSite =
#ifdef DEVELOPMENT
Static.staticDevel staticDir
#else
Static.static staticDir
#endif
-- | This generates easy references to files in the static directory at compile time,
-- giving you compile-time verification that referenced files exist.
-- Warning: any files added to your static directory during run-time can't be
-- accessed this way. You'll have to use their FilePath or URL to access them.
$(staticFiles "static")
$(staticFiles Settings.staticDir)

View File

@ -9,7 +9,7 @@ Default: &defaults
Development:
<<: *defaults
Testing:
Test:
database: ~project~_test
<<: *defaults

View File

@ -9,7 +9,7 @@ Default: &defaults
Development:
<<: *defaults
Testing:
Test:
database: ~project~_test
<<: *defaults

View File

@ -5,7 +5,7 @@ Default: &defaults
Development:
<<: *defaults
Testing:
Test:
<<: *defaults
Staging:

View File

@ -5,7 +5,7 @@ Default: &defaults
Development:
<<: *defaults
Testing:
Test:
database: ~project~_test.sqlite3
<<: *defaults

View File

@ -6,7 +6,7 @@ module Application
import Import
import Settings
import Yesod.Static
import Settings.StaticFiles (staticSite)
import Yesod.Default.Config
import Yesod.Default.Main (defaultDevelApp, defaultRunner)
import Yesod.Default.Handlers (getFaviconR, getRobotsR)
@ -28,11 +28,7 @@ mkYesodDispatch "~sitearg~" resources~sitearg~
-- migrations handled by Yesod.
with~sitearg~ :: AppConfig DefaultEnv () -> Logger -> (Application -> IO ()) -> IO ()
with~sitearg~ conf logger f = do
#ifdef DEVELOPMENT
s <- staticDevel Settings.staticDir
#else
s <- static Settings.staticDir
#endif
s <- staticSite
let h = ~sitearg~ conf logger s
defaultRunner f h