{"id":14968079,"url":"https://github.com/nmattia/wai-lambda","last_synced_at":"2025-12-11T23:29:03.496Z","repository":{"id":56882283,"uuid":"176738127","full_name":"nmattia/wai-lambda","owner":"nmattia","description":"Haskell Webapps on AWS Lambda","archived":false,"fork":false,"pushed_at":"2023-02-05T21:36:05.000Z","size":173,"stargazers_count":43,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T13:16:47.299Z","etag":null,"topics":["aws","aws-lambda","haskell","nix","webapp"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmattia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-20T13:19:18.000Z","updated_at":"2024-11-27T17:17:24.000Z","dependencies_parsed_at":"2023-02-19T02:15:34.663Z","dependency_job_id":null,"html_url":"https://github.com/nmattia/wai-lambda","commit_stats":null,"previous_names":["deckgo/wai-lambda"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nmattia/wai-lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmattia%2Fwai-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmattia%2Fwai-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmattia%2Fwai-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmattia%2Fwai-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmattia","download_url":"https://codeload.github.com/nmattia/wai-lambda/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmattia%2Fwai-lambda/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260678829,"owners_count":23045367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","haskell","nix","webapp"],"created_at":"2024-09-24T13:39:12.922Z","updated_at":"2025-12-11T23:28:58.471Z","avatar_url":"https://github.com/nmattia.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/wai-lambda.png\" alt=\"wai-lambda\" width=\"200\"/\u003e\n\u003c/p\u003e\n\n# WAI Lambda - Haskell Webapps on AWS Lambda\n\n[![Hackage](https://img.shields.io/hackage/v/wai-lambda.svg)](https://hackage.haskell.org/package/wai-lambda)\n\nThis Haskell library turns any [wai] webapp ([spock], [servant], etc) into a\nhandler for AWS [Lambda][lambda] and [API Gateway][api-gateway] requests.\n\n``` haskell\n{-# LANGUAGE OverloadedStrings #-}\nimport Network.Wai\nimport Network.HTTP.Types\nimport Network.Wai.Handler.Lambda (run)\n\napp :: Application\napp _ respond = do\n    putStrLn \"I've done some IO here\"\n    respond $ responseLBS\n        status200\n        [(\"Content-Type\", \"text/plain\")]\n        \"Hello, Web!\"\n\nmain :: IO ()\nmain = run app\n```\n\nThis doesn't require any particular Lambda environment. By following the\ninstructions in the [build](#build) section the resulting `zip` file uploaded\nto AWS Lambda is typically smaller than 1MB. For basic webapps the request\nhandling duration (as reported by AWS) is between 1 and 5 milliseconds.\n\n* [**Install**](#install) with either Cabal, stack or Nix.\n* [**Build for AWS**](#build) with Nix and fully static executables.\n* [**Deploy to AWS**](#deploy) with Nix and Terraform.\n\n## Install\n\n### Cabal\n\nInstalling with Cabal:\n\n``` shell\n$ cabal install wai-lambda\n```\n\n### Stack\n\nIf you use stack and `wai-lambda` is not included in your snapshot, add it to\nthe `extra-deps`:\n\n``` yaml\nextra-deps:\n  - wai-lambda-0.1.0.0\n```\n\nor from GitHub:\n\n``` yaml\npackages:\n- ...\n- location:\n    git: https://github.com/deckgo/wai-lambda.git\n    commit: \u003csome commit\u003e\n  extra-dep: true\n```\n\n### Nix\n\nYou do not have to do anything if you use cabal2nix and a Nix commit that\nincludes `wai-lambda` in its Hackage dependencies. If you want to use a\nspecific commit of `wai-lambda` we recommend using [niv]:\n\n``` shell\n$ niv add deckgo/wai-lambda\n```\n\nThen add an override to your Nix packages:\n\n``` nix\n\nrec\n{\n    sources = import ./nix/sources.nix; # from niv\n    pkgs = import sources.nixpkgs {};\n\n    myHaskellPackages = pkgs.haskellPackages.override\n        { overrides = self: super:\n            { \"wai-lambda\" =\n                super.callCabal2nix \"wai-lambda\" sources.wai-lambda;\n            };\n        };\n}\n```\n\nSee also the [build](#build) section for producing AWS Lambda packages with\nnix.\n\n## Build\n\n_TODO_\n\nFor inspiration on how to build fully static executables with Nix, see\n[DeckDeckGo](https://github.com/deckgo/deckdeckgo/tree/master/infra)\n\n## Deploy\n\n_TODO_\n\nFor inspiration on how to deploy with Terraform and Nix, see\n[DeckDeckGo](https://github.com/deckgo/deckdeckgo/tree/master/infra)\n\n## License\n\nMIT © [David Dal Busco](mailto:david.dalbusco@outlook.com) and [Nicolas Mattia](mailto:nicolas@nmattia.com)\n\n[wai]: https://www.stackage.org/package/wai\n[spock]: https://www.spock.li/\n[servant]: https://docs.servant.dev/en/stable/\n[lambda]: https://aws.amazon.com/lambda/\n[api-gateway]: https://aws.amazon.com/api-gateway/\n[niv]: https://github.com/nmattia/niv\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmattia%2Fwai-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmattia%2Fwai-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmattia%2Fwai-lambda/lists"}