{-# LANGUAGE OverloadedStrings #-} import Types import Routes import Network.Wai (Request, Response, pathInfo, queryString) import Network.Wai.Parse (parseRequestBody, lbsBackEnd) import Network.Wai.Handler.Warp (run) import Control.Monad.Trans (lift, liftIO) import Data.Conduit (ResourceT) import Control.Concurrent.STM import qualified Jungle as J application :: TJungle -> Request -> ResourceT IO Response application jungle request = do let function = routes $ pathInfo request query = queryString request (params, _) <- parseRequestBody lbsBackEnd request liftIO $ print params lift $ function jungle query params main = do putStrLn $ "Listening on port " ++ show 3000 jungle <- newJungle run 3000 $ application jungle