@hackage aws-lambda-haskell-runtime-wai2.0.2
Run wai applications on AWS Lambda
Categories
License
BSD-3-Clause
Maintainer
dnikolovv@hotmail.com
Links
Versions
Installation
Dependencies (13)
- aeson
- aws-lambda-haskell-runtime >=4.0.0
- base >=4.7 && <5
- binary
- bytestring
- case-insensitive Show all…
Dependents (1)
@hackage/microformats2-parser
aws-lambda-haskell-runtime-wai

Quick start
- Set up your project to use AWS Lambda by following the instructions on the aws-lambda-haskell-runtime website.
- Use the
waiHandlerfunction fromAWS.Lambda.Waito convert yourwaiapplication to a handler. There are two ways to do this.
-- 1. Pass in the initializeApplicationFunction
-- this will call initializeApplication per each call
handler :: WaiHandler ()
handler = waiHandler initializeApplication
-- Wai application initialization logic
initializeApplication :: IO Application
initializeApplication = ...
-- 2. Store the Application inside your custom context and provide a getter function
-- this will initialize the application once per cold start and keep it alive while the lambda is warm
handler :: WaiHandler MyAppConfig
handler = waiHandler' getWaiApp
data MyAppConfig =
MyAppConfig
{ getWaiApp :: Application }
For a complete example see theam/aws-lambda-haskell-runtime/tree/master/examples/wai-app