Created
October 23, 2011 19:03
-
-
Save alistra/1307724 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
withImgurDirectoryListing conf logger f = do | |
#ifdef PRODUCTION | |
s <- static Settings.staticDir | |
#else | |
s <- staticDevel Settings.staticDir | |
#endif | |
dbconf <- withYamlEnvironment "config/sqlite.yml" (appEnv conf) | |
$ either error return . Database.Persist.Base.loadConfig | |
Database.Persist.Base.withPool (dbconf :: Settings.PersistConfig) $ \p -> do | |
Database.Persist.Base.runPool dbconf (runMigration migrateAll) p | |
let h = ImgurDirectoryListing conf logger s p | |
defaultRunner f h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment