Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type GameRequestHandler a = GameRequest -> IO a
- runBattlesnakeServer :: InfoResponse -> GameRequestHandler () -> GameRequestHandler MoveResponse -> GameRequestHandler () -> IO ()
Documentation
type GameRequestHandler a = GameRequest -> IO a Source #
A handler for a battlesnake server request.
runBattlesnakeServer :: 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.
* A Battlesnake.API.InfoResponse to be returned when the server receives an info request.
* 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.