we have a running webserver (nothing tested)
This commit is contained in:
parent
fecda5bd45
commit
e4339fb38d
4 changed files with 47 additions and 2 deletions
17
app/WaiApp.hs
Normal file
17
app/WaiApp.hs
Normal file
|
@ -0,0 +1,17 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module WaiApp (waiApplication, WSA.newServerState, WSA.ServerState) where
|
||||
|
||||
import qualified WebSocketApp as WSA
|
||||
import qualified Network.WebSockets as WS
|
||||
import Network.Wai.Handler.WebSockets
|
||||
import Network.Wai
|
||||
import Network.HTTP.Types
|
||||
import Control.Concurrent.MVar
|
||||
|
||||
waiApplication :: MVar WSA.ServerState -> Application
|
||||
waiApplication serverState = websocketsOr WS.defaultConnectionOptions (WSA.application serverState) clientServer
|
||||
|
||||
-- this should serve the webclient see Network.Wai.responseFile
|
||||
clientServer :: Application
|
||||
clientServer _ respond = respond $ responseLBS status404 [] "No webclient implemented (Franzi essen ?? -- Emma)"
|
Loading…
Add table
Add a link
Reference in a new issue