Implementation of the Strategy Pattern on AWS Lambda
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": "scheme"}' http://localhost:3000
To execute automated tests, run bun test
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/strategy-pattern --follow
To test the deployed function, run curl -X POST -H "Content-Type: application/json" -d '{"type": "scheme"}' <API_GATEWAY_URL>