Search code examples
node.jsamazon-web-servicesaws-lambdaaws-sdk-nodejs

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;

Solution

  • I am guessing you are looking at lambda template, which include statusCode in the return but there is no requirement to return a status code, or in fact, anything at all.