Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (16 sloc) 0.717 kB
module Main where
import HTTP.Server ( httpServer, pure )
import HTTP.FileServer ( fileServer )
import HTTP.LoginServer ( LoginMessage(SendMessage), loginServer, loginThread )
import HTTP.DirHandler ( dirHandler )
import HTTP.ChatHandler ( chatHandler )
import HTTP.Dominion ( dominionHandler )
import TCP.Chan ( pipe, writeOutput )
import Control.Concurrent ( forkIO )
main :: IO ()
main = do (li,lo) <- pipe
forkIO $ loginThread li []
let sendM a s = writeOutput lo $ SendMessage a s
dh <- dirHandler [(Just "chat", chatHandler "chat" sendM),
(Just "silly", dominionHandler "silly" sendM)]
httpServer 8081 $ pure $ loginServer lo fileServer dh
Jump to Line
Something went wrong with that request. Please try again.