func marshalJSONAndSend(res []Story) (events.APIGatewayProxyResponse, error) {
response, err := json.Marshal(res)
if err != nil {
return handleError(err)
}
return events.APIGatewayProxyResponse{
Body: string(response),
StatusCode: 200,
}, nil
}
view raw pt-9.main.go hosted with ❤ by GitHub