wrapped everything in the EnvM Monad, the logging might commence

This commit is contained in:
Dennis Frieberg 2021-04-05 22:11:07 +02:00
parent 27a51c2121
commit ac303abcc0
7 changed files with 78 additions and 51 deletions

View file

@ -8,9 +8,13 @@ import Network.Wai.Handler.WebSockets
import Network.Wai
import Network.HTTP.Types
import Control.Concurrent.MVar
import Control.Monad.Reader.Class
import Environment
waiApplication :: MVar WSA.ServerState -> Application
waiApplication serverState = websocketsOr WS.defaultConnectionOptions (WSA.application serverState) clientServer
waiApplication :: MVar WSA.ServerState -> EnvM Application
waiApplication serverState = do
app <- WSA.application serverState
return $ websocketsOr WS.defaultConnectionOptions app clientServer
-- this should serve the webclient see Network.Wai.responseFile
clientServer :: Application