Created
May 21, 2020 16:00
-
-
Save thebeebs/4acba73e61cf67fbda838f1d34083f99 to your computer and use it in GitHub Desktop.
Lambda Injection Prototype
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[InjectDelayPolicy] | |
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, | |
ILambdaContext context) | |
{ | |
var location = await GetCallingIP(); | |
var body = new Dictionary<string, string> | |
{ | |
{"message", "hello world"}, | |
{"location", location} | |
}; | |
return new APIGatewayProxyResponse | |
{ | |
Body = JsonConvert.SerializeObject(body), | |
StatusCode = 200, | |
Headers = new Dictionary<string, string> {{"Content-Type", "application/json"}} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment