[all] Reorganize haskell code into multiple packages
This commit is contained in:
parent
0edc241149
commit
4b8d0ee4a4
37 changed files with 368 additions and 140 deletions
|
|
@ -1,37 +0,0 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Main where
|
||||
|
||||
import Control.Concurrent.MVar
|
||||
import qualified Network.WebSockets as WS
|
||||
|
||||
import Forest.Node
|
||||
import Forest.Server
|
||||
import Forest.Server.Broadcast
|
||||
import Forest.Server.TreeModule.Const
|
||||
import Forest.Server.TreeModule.Fork
|
||||
import Forest.Server.TreeModule.SharedEditing
|
||||
|
||||
pingDelay :: Int
|
||||
pingDelay = 10
|
||||
|
||||
pongDelay :: Int
|
||||
pongDelay = 3 * pingDelay
|
||||
|
||||
options :: WS.ServerOptions
|
||||
options = WS.defaultServerOptions
|
||||
{ WS.serverRequirePong = Just pongDelay
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
putStrLn "Preparing shared edit module"
|
||||
sharedEditNodeVar <- newMVar $ txtNode "r" ""
|
||||
sharedEditBroadcaster <- newBroadcaster
|
||||
|
||||
putStrLn "Starting server"
|
||||
WS.runServerWithOptions options $ serverApp pingDelay $ forkModule "Forest"
|
||||
[ ProngConstructor "Test" $ constModule $ newNode "" "" [txtNode "" "Bla"]
|
||||
, ProngConstructor "Sandbox" $ sharedEditingModule sharedEditNodeVar sharedEditBroadcaster
|
||||
, ProngConstructor "About" $ constModule projectDescriptionNode
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue