in playground/Lambda/WebCalculatorFunctions/Functions.cs [48:66]
public APIGatewayHttpApiV2ProxyResponse MinusFunctionHandler(APIGatewayHttpApiV2ProxyRequest request, ILambdaContext context)
=> AWSLambdaWrapper.Trace(_traceProvider, (request, context) =>
{
var x = (int)Convert.ChangeType(request.PathParameters["x"], typeof(int));
var y = (int)Convert.ChangeType(request.PathParameters["y"], typeof(int));
var total = x - y;
context.Logger.LogInformation($"Subtracting {y} from {x} equals {total}");
var response = new APIGatewayHttpApiV2ProxyResponse
{
StatusCode = 200,
Headers = new Dictionary<string, string>
{
{"Content-Type", "application/json" }
},
Body = total.ToString()
};
return response;
}, request, context);