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

[ aws, bsd3, library ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/eir-forsakring/aws-lambda-haskell-runtime-wai#readme


[Skip to Readme]
Versions [faq] 1.0.0
Change log ChangeLog.md
Dependencies aeson, aws-lambda-haskell-runtime (>=3.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
Maintainer dnikolovv@hotmail.com
Category AWS
Home page https://github.com/eir-forsakring/aws-lambda-haskell-runtime-wai#readme
Bug tracker https://github.com/eir-forsakring/aws-lambda-haskell-runtime-wai/issues
Source repo head: git clone https://github.com/eir-forsakring/aws-lambda-haskell-runtime-wai
Uploaded by dnikolovv at 2020-06-19T12:31:48Z
Distributions NixOS:1.0.0
Downloads 38 total (38 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2020-06-19 [all 2 reports]

Modules

  • Aws
    • Lambda
      • Aws.Lambda.Wai

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


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

[back to package description]

aws-lambda-haskell-runtime-wai 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 =
  MyAppConfig
    { getWaiApp :: Application }