aws-lambda-haskell-runtime-wai: Run wai applications on AWS Lambda

[ aws, bsd3, library ] [ Propose Tags ]


[Index] [Quick Jump]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS] 1.0.0, 1.0.1, 1.0.2, 2.0.0, 2.0.1, 2.0.2
Change log
Dependencies aeson, aws-lambda-haskell-runtime (>=4.0.0), base (>=4.7 && <5), binary, bytestring, case-insensitive, http-types, iproute, network, text, unordered-containers, vault, wai [details]
License BSD-3-Clause
Copyright Eir Försäkring
Author Dobromir Nikolov
Category AWS
Home page
Bug tracker
Source repo head: git clone
Uploaded by dnikolovv at 2021-06-30T16:09:31Z
Distributions NixOS:2.0.2, Stackage:2.0.2
Downloads 1175 total (28 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-06-30 [all 1 reports]

Readme for aws-lambda-haskell-runtime-wai-2.0.2

[back to package description]

aws-lambda-haskell-runtime-wai Hackage Haskell CI

Quick start

  1. Set up your project to use AWS Lambda by following the instructions on the aws-lambda-haskell-runtime website.
  2. Use the waiHandler function from AWS.Lambda.Wai to convert your wai application 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 =
    { getWaiApp :: Application }

For a complete example see theam/aws-lambda-haskell-runtime/tree/master/examples/wai-app