2022-07-01 20:34:29 -05:00
|
|
|
module Lib ( main ) where
|
2022-06-28 20:30:09 -05:00
|
|
|
|
2022-07-01 20:34:29 -05:00
|
|
|
import qualified Core.Configuration as Configuration
|
|
|
|
import qualified Core.HTTP as HTTP
|
2022-07-05 20:11:41 -05:00
|
|
|
import qualified Core.Couch as DB
|
2022-07-03 21:48:40 -05:00
|
|
|
import Core.Types
|
2022-07-01 20:34:29 -05:00
|
|
|
|
|
|
|
import Control.Monad.Reader (liftIO, runReaderT)
|
|
|
|
import GHC.Natural (popCountNatural)
|
|
|
|
import Prelude hiding (id)
|
2022-07-03 21:48:40 -05:00
|
|
|
import Web.Scotty.Trans (scottyT)
|
2022-07-01 20:34:29 -05:00
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main = do
|
|
|
|
dhallConf <- liftIO Configuration.main
|
2022-07-05 20:11:41 -05:00
|
|
|
scottyT (applicationPort dhallConf) (flip runApp dhallConf) HTTP.app where
|
|
|
|
runApp :: ConfigM a -> DhallConfig -> IO a
|
2022-07-03 21:48:40 -05:00
|
|
|
runApp m = runReaderT (runConfigM m)
|