Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type GameRequestHandler a = GameRequest -> IO a
- runBattlesnakeServer :: IO InfoResponse -> GameRequestHandler () -> GameRequestHandler MoveResponse -> GameRequestHandler () -> IO ()
Documentation
type GameRequestHandler a = GameRequest -> IO a Source #
A handler for a battlesnake server request.
runBattlesnakeServer :: IO InfoResponse -> GameRequestHandler () -> GameRequestHandler MoveResponse -> GameRequestHandler () -> IO () Source #
Run a battlesnake server. Runs the server on the port specified by the environment variable PORT or port 3000 if the variable is not set.
- An IO action that returns a Battlesnake.API.InfoResponse which is run on info requests.
- A
GameRequestHandler
to be called when the server receives a start request. - A
GameRequestHandler
to be called when the server receives a move request. - A
GameRequestHandler
to be called when the server receives an end request.