Skip to content

Instantly share code, notes, and snippets.

@alistra
Created October 23, 2011 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alistra/1307724 to your computer and use it in GitHub Desktop.
Save alistra/1307724 to your computer and use it in GitHub Desktop.
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