yesod-default-1.0.1: Default config and main functions for your yesod application

Safe HaskellSafe-Infered




defaultMain :: (Show env, Read env) => IO (AppConfig env extra) -> (AppConfig env extra -> Logger -> IO Application) -> IO ()Source

Run your app, taking environment and port settings from the commandline.

fromArgs helps parse a custom configuration

 main :: IO ()
 main = defaultMain (fromArgs parseExtra) makeApplication

defaultRunner :: (Application -> IO ()) -> Application -> IO ()Source

Run your application continously, listening for SIGINT and exiting when recieved

 withYourSite :: AppConfig DefaultEnv -> Logger -> (Application -> IO a) -> IO ()
 withYourSite conf logger f = do
     Settings.withConnectionPool conf $ \p -> do
         runConnectionPool (runMigration yourMigration) p
         defaultRunner f $ YourSite conf logger p



:: (Show env, Read env) 
=> IO (AppConfig env extra)

A means to load your development AppConfig

-> (AppConfig env extra -> Logger -> IO Application)

Get your Application

-> IO (Int, Application) 

Run your development app using a custom environment type and loader function