Skip to content

Commit 69b5ac6

Browse files
committed
Add extra data to wrapLambda call
This adds lambda and service name to the wrapLambda call so that a user can identify the lambda. This can be useful, for example, if you want to log automatically in the wrapper.
1 parent 6666a7c commit 69b5ac6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ module.exports = function(options) {
4949
const funcConf = slsConf.functions[funcId];
5050
let func = getObjectPath(funcConf.handler, slsHandlers);
5151
if (httpConfig.wrapLambda) {
52-
func = httpConfig.wrapLambda(func);
52+
func = httpConfig.wrapLambda(func, {
53+
lambdaName: funcId,
54+
serviceName: slsConf.service,
55+
});
5356
}
5457
service[funcId] = func;
5558
// http event source setup

0 commit comments

Comments
 (0)