wai-lambda-0.1.0.0: Haskell Webapps on AWS Lambda

Safe HaskellNone
LanguageHaskell2010

Lambda

Synopsis

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.

handleRequest Source #

Arguments

:: Application 
-> Int

Timeout in microseconds

-> ByteString

The request (see decodeInput)

-> 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.