import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad
import Network.Wai.Handler.Warp
import Network.Socket.Internal
import Servant

import Chat

type API = ChatAPI
      :<|> Raw

server :: Server API
server = chatServer
    :<|> serveDirectory "www"

main :: IO ()
main = runServer
    where settings =
            setPort 8080 $
            setOnOpen onOpen
            defaultSettings
          api = Proxy :: Proxy API
          app = serve api server
          runServer = runSettings settings app

onOpen :: SockAddr -> IO Bool
onOpen addr = return True

import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad
import Network.Wai.Handler.Warp
import Network.Socket.Internal
import Servant

import Chat

type API = ChatAPI
      :<|> Raw

server :: Server API
server = chatServer
    :<|> serveDirectory "www"

port :: Int
port = 8081

main :: IO ()
main = runServer
    where settings =
            setPort port $
            setOnOpen onOpen
            defaultSettings
          api = Proxy :: Proxy API
          app = serve api server
          runServer = runSettings settings app

onOpen :: SockAddr -> IO Bool
onOpen addr = return True

Change port to 8081 (8080 doesn't work on OS X, hm).
Change port to 8081 (8080 doesn't work on OS X, hm).
