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 | |
} |