Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support latest handler arguments, callback #1

Open
samdj opened this issue Jun 2, 2016 · 4 comments
Open

Support latest handler arguments, callback #1

samdj opened this issue Jun 2, 2016 · 4 comments

Comments

@samdj
Copy link

samdj commented Jun 2, 2016

Currently I have to set the callback as so:

export function handler(event, context, done) {
    done = done || context.done

    return done(null, {
        message: 'Go Serverless! Your Lambda function executed successfully!'
    })
}

Apparently the new lambda API encourages use of the 3rd optional callback.

May be worthwhile for normalizing: https://github.com/SC5/lambda-wrapper

@samdj samdj mentioned this issue Jun 2, 2016
@thenikso
Copy link
Member

I wasn't aware of that lambda-wrapper project. I'll give it a look at some point.

What actions should be taken on this @samdj ?

@samdj
Copy link
Author

samdj commented Jun 14, 2016

I'll do some testing to see whether this is node43 related and whether the lambda wrapper is necessary.

@samdj
Copy link
Author

samdj commented Jun 18, 2016

@thenikso I can confirm we need to use the lambda-wrapper. The third argument needs to be set under node4.3.

@thenikso
Copy link
Member

would it make sense to use the 3rd argument as the callback directly? We're already doing so in https://github.com/elastic-coders/serverless-webpack for serverless 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants