@@ -2,6 +2,7 @@ This is the Haskell implementation of the example for the WebSockets library. We
22implement a simple multi-user chat program.
33
44> {-# LANGUAGE OverloadedStrings #-}
5+> {-# LANGUAGE TemplateHaskell #-}
56> import Data.Char (isPunctuation, isSpace)
67> import Data.Monoid (mappend)
78> import Data.Text (Text)
@@ -15,6 +16,7 @@ implement a simple multi-user chat program.
1516> import qualified Network.Wai.Handler.Warp as Warp
1617> import qualified Network.Wai.Handler.WebSockets as WaiWS
1718> import qualified Network.Wai.Application.Static as Static
19+> import Data.FileEmbed (embedDir)
1820
1921We represent a client by his username and a 'WS.Sender'. We can use this sender
2022to asynchronously send 'Text' to the client later.
@@ -66,6 +68,7 @@ actual server. For this purpose, we use the simple server provided by
6668
6769> main :: IO ()
6870> main = do
71+> putStrLn "http://localhost:9160/client.html"
6972> state <- newMVar newServerState
7073> Warp.runSettings Warp.defaultSettings
7174> { Warp.settingsPort = 9160
@@ -73,7 +76,7 @@ actual server. For this purpose, we use the simple server provided by
7376> } staticApp
7477
7578> staticApp = Static.staticApp Static.defaultFileServerSettings
76−> { Static.ssFolder = Static.fileSystemLookup $ Static.toFilePath "."
79+> { Static.ssFolder = Static.embeddedLookup $ Static.toEmbedded $(embedDir "static")
7780> }
7881
7982> webSocketsApp state = do