Pattern matching on Lambda with Bun
To start a local Bun server, run bun index.ts
Or, to enable hot reloading run bun --hot index.ts
To test the function locally, run curl -X POST -H "Content-Type: application/json" -d '{"type": "a"}' http://localhost:3000
Run bunx cdk deploy to deploy the CDK stack to your AWS account.
To enable hot reloading for the deployed function and infrastructure, run bunx cdk watch --hotswap
This will also print live logs from the function to stdout.
NOTE: You can view live logs from the function (without running CDK watch mode) by running aws logs tail /aws/lambda/pattern-matcher --follow
To test the deployed function, run curl -X POST -H "Content-Type: application/json" -d '{"test": true}' <API_GATEWAY_URL>