lucydavinhart / api.lmhd.me

The shiny new LMHD API
1 stars 0 forks source link

dev and prod both seem to be using the same Lambda functions #4

Closed lucymhdavies closed 3 years ago

lucymhdavies commented 3 years ago

I've added a X-LMHD-Req-String response header for testing, and it looks like both are using the same stage when using the custom domains

$ for api in https://api.test.lmhd.me https://api.lmhd.me ; do curl -v ${api}/v1/name 2>&1 | grep x-lmhd-req-string | sed 's/< x-lmhd-req-string://' | jq .requestContext.stage; done
"dev"
"dev"

https://github.com/lucydavinhart/api.lmhd.me/blob/main/v1/main.go#L114-L122

https://github.com/lucydavinhart/api.lmhd.me/blob/main/v1/main.go#L75

When using the endpoints directly (in this case from https://app.circleci.com/pipelines/github/lucydavinhart/api.lmhd.me/23/workflows/2fe4aa6f-20fe-4454-b91d-03aed8387466/jobs/46), we do get the correct lambda functions:

$ for api in https://28w045e9a5.execute-api.us-east-1.amazonaws.com/dev https://wda33hqws0.execute-api.us-east-1.amazonaws.com/prod ; do curl -v ${api}/v1/name 2>&1 | grep x-lmhd-req-string | sed 's/< x-lmhd-req-string://' | jq .requestContext.stage; done
"dev"
"prod"