Safe Haskell | None |
---|
- defaultMain :: (Show env, Read env) => IO (AppConfig env extra) -> (AppConfig env extra -> IO Application) -> IO ()
- defaultMainLog :: (Show env, Read env) => IO (AppConfig env extra) -> (AppConfig env extra -> IO (Application, LogFunc)) -> IO ()
- defaultRunner :: (Application -> IO ()) -> Application -> IO ()
- defaultDevelApp :: (Show env, Read env) => IO (AppConfig env extra) -> (AppConfig env extra -> IO Application) -> IO (Int, Application)
- type LogFunc = Loc -> LogSource -> LogLevel -> LogStr -> IO ()
Documentation
defaultMain :: (Show env, Read env) => IO (AppConfig env extra) -> (AppConfig env extra -> IO Application) -> IO ()Source
Run your app, taking environment and port settings from the commandline.
helps parse a custom configuration
fromArgs
main :: IO () main = defaultMain (fromArgs parseExtra) makeApplication
defaultMainLog :: (Show env, Read env) => IO (AppConfig env extra) -> (AppConfig env extra -> IO (Application, LogFunc)) -> IO ()Source
Same as defaultMain
, but gets a logging function back as well as an
Application
to install Warp exception handlers.
Since 1.2.5
defaultRunner :: (Application -> IO ()) -> Application -> IO ()Source
Run your application continously, listening for SIGINT and exiting when received
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