Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- run :: Application -> IO ()
- handleRequest :: Settings -> Application -> ByteString -> IO ()
Documentation
run :: Application -> IO () Source #
Run an Application
.
Continuously reads requests from stdin
. Each line should be a a JSON
document as described in decodeInput
.
All requests will be timed out after 2 seconds. If any exception
is thrown while processing the request this will return an HTTP 500
Internal Server Error
.
If you need more control use handleRequest
directly.
:: Settings | |
-> Application | |
-> ByteString | The request (see |
-> IO () |
Parse and handle the request.
- Returns 504 if no response is available after the specified timeout.
- Returns 500 if an exception occurs while processing the request.
- Throws an exception if the input cannot be parsed.