Skip to content

Commit

Permalink
Add nodejs12.x Support
Browse files Browse the repository at this point in the history
Closes #10
  • Loading branch information
kolanos committed Nov 19, 2019
1 parent d111ae1 commit e247444
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ This plugin currently supports the following AWS runtimes:

* nodejs8.10
* nodejs10.x
* nodejs12.x
* python2.7
* python3.6
* python3.7
2 changes: 1 addition & 1 deletion examples/nodejs/handler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports.handler = (event, context, callback) => {
callback(null, 200);
callback(null, 'hi there');
};
11 changes: 11 additions & 0 deletions examples/nodejs/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,14 @@ functions:
include:
- handler.js
runtime: nodejs10.x

layer-nodejs12x:
events:
- schedule: rate(5 minutes)
handler: handler.handler
package:
exclude:
- ./**
include:
- handler.js
runtime: nodejs12.x
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export default class NewRelicLambdaLayerPlugin {
typeof runtime !== "string" ||
[
"nodejs10.x",
"nodejs12.x",
"nodejs8.10",
"python2.7",
"python3.6",
Expand Down Expand Up @@ -226,7 +227,7 @@ export default class NewRelicLambdaLayerPlugin {
}

private getHandlerWrapper(runtime: string, handler: string) {
if (runtime === "nodejs10.x") {
if (["nodejs10.x", "nodejs12.x"].indexOf(runtime) !== -1) {
return "newrelic-lambda-wrapper.handler";
}

Expand Down

0 comments on commit e247444

Please sign in to comment.