https://github.com/tsnobip/reason-lambda
bindings for AWS Lambda handlers
https://github.com/tsnobip/reason-lambda
Last synced: 6 months ago
JSON representation
bindings for AWS Lambda handlers
- Host: GitHub
- URL: https://github.com/tsnobip/reason-lambda
- Owner: tsnobip
- Created: 2020-05-25T15:29:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-23T15:48:11.000Z (over 5 years ago)
- Last Synced: 2025-05-11T09:47:50.310Z (8 months ago)
- Language: Reason
- Homepage:
- Size: 4.88 KB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
Awesome Lists containing this project
- awesome-list - reason-lambda
README
# Reason-Lambda
`reason-lambda` is a set of bindings for AWS Lambda handlers.
It makes use of Bucklescript 7 representation of records as JS objects.
It includes bindings for both [v1 and v2 of lambda payloads](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html).
## Install
```
yarn add @tsnobip/reason-lambda
```
And add `@tsnobip/reason-lambda` to the `bs-dependencies` of `bsconfig.json`.
## Usage
```reason
open ReasonLambda.V2;
type greetings = {greetings: string};
let handler: handler =
(_event, _context) =>
{greetings: "Hello world!"}->Response.fromBody->Js.Promise.resolve;
```
You can see a working example with the Serverless framework [here](https://github.com/tsnobip/reason-sls-example).