This project is to demonstrate the bug middyjs/middy#1263
- Login to aws account
npm run cdk deploy
- Invoke the lambda using the test console with
payloadInputa.json
- Lambda responds with
{
"statusCode": 200,
"body": "{\"hi\":\"there\"}",
"headers": {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "http://localhost:3000",
"Vary": "Origin"
}
}
- Invoke the lambda using the test console with
payloadInputb.json
,Access-Control-Allow-Origin
is stillhttp://localhost:3000
instead of expectedhttps://example.org
.
{
"statusCode": 200,
"body": "{\"hi\":\"there\"}",
"headers": {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "http://localhost:3000",
"Vary": "Origin, Origin"
}
}
- Login to aws account
npm run cdk:integ
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testsnpx cdk deploy
deploy this stack to your default AWS account/regionnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template