Safe Haskell | Safe-Infered |
---|
- defaultMain :: (Show env, Read env) => IO (AppConfig env extra) -> (AppConfig env extra -> Logger -> IO Application) -> IO ()
- defaultRunner :: (Application -> IO ()) -> Application -> IO ()
- defaultDevelApp :: (Show env, Read env) => IO (AppConfig env extra) -> (AppConfig env extra -> Logger -> IO Application) -> IO (Int, Application)
Documentation
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.
Use
when using the provided fromArgs
type, or
DefaultEnv
when using a custom type
fromArgsWith
main :: IO () main = defaultMain fromArgs withMySite
or
main :: IO () main = defaultMain (fromArgsWith customArgConfig) withMySite
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