Skip to content

Commit

Permalink
Merge pull request #166 from jaredh159/fix-empty-warning
Browse files Browse the repository at this point in the history
fix empty lambda warning
  • Loading branch information
RaeesBhatti authored Aug 1, 2019
2 parents 6abf6c3 + 3fd1f38 commit 57e5cb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ function createCallback(response) {
);
} else {
if (
process.env.CONTEXT !== "production" ||
response.statusCode !== 204 &&
process.env.CONTEXT !== "production" &&
!process.env.SILENCE_EMPTY_LAMBDA_WARNING
)
console.log(
`Your lambda function didn't return a body, which may be a mistake. Check our Usage docs for examples (https://github.com/netlify/netlify-lambda#usage).
If this is intentional, you can silence this warning by setting process.ENV.SILENCE_EMPTY_LAMBDA_WARNING to a truthy value or process.env.CONTEXT to 'production'`
If this is intentional, you can silence this warning by setting process.env.SILENCE_EMPTY_LAMBDA_WARNING to a truthy value or process.env.CONTEXT to 'production'`
);
}
response.end();
Expand Down

0 comments on commit 57e5cb5

Please sign in to comment.