infernal-0.3.0: The Infernal Machine - An AWS Lambda Custom Runtime for Haskell

Safe HaskellNone
LanguageHaskell2010

Infernal.Wai

Description

Functions to let you wrap WAI Applications and use them to serve API Gateway requests. See runSimpleWaiLambda for a simple entrypoint.

Synopsis

Documentation

adaptApplication :: MonadIO n => Application -> APIGatewayProxyRequest -> n APIGatewayProxyResponse Source #

Adapt a WAI Application into a function that handles API Gateway proxy requests.

adaptRequest :: APIGatewayProxyRequest -> Request Source #

Turn an APIGatewayProxyRequest into a WAI Request. (Not all fields will be present!)

adaptResponse :: MonadIO n => Response -> n APIGatewayProxyResponse Source #

Turn a WAI Response into an APIGatewayProxyResponse, materializing the whole response body.

applicationCallback :: (MonadThrow n, WithSimpleLog env n) => Application -> RunCallback n Source #

Adapt a WAI Application into a RunCallback to handle API Gateway proxy requests encoded as Lambda requests.

runSimpleWaiLambda :: Application -> IO () Source #

A simple entrypoint to run your WAI Application in a Lambda function. (See runSimpleLambda for more information on these entrypoints.) You can configure API Gateway to send proxied HTTP requests as JSON to your Lambda (as APIGatewayProxyRequest) and have your WAI Application service them with this entrypoint. (Correct API Gateway configuration is pretty tricky, so consult all the documentation available to figure it out.)