是否需要在使用 node.js 从 lambda 函数返回响应时发送 statusCode?

Is it necessary to send statusCode while returning a response from the lambda function using node.js?

const response = {
    statusCode: 200,
    body: JSON.stringify('File Uploaded Successfully.')
};

return response;

我猜您正在查看 lambda 模板,它在 return 中包含 statusCode 但不需要 return 状态代码,或者实际上根本不需要任何东西。