Created
January 17, 2019 05:32
-
-
Save eduardoromero/50e7041c221adaa84e27df6a4f73d862 to your computer and use it in GitHub Desktop.
Lambda function with IOPipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const iopipeLib = require('@iopipe/iopipe') | |
const tracePlugin = require('@iopipe/trace') | |
const iopipe = iopipeLib({ | |
token: process.env.IOPIPE_TOKEN || '', | |
enabled: Boolean(process.env.IOPIPE_TOKEN), | |
plugins: [ | |
tracePlugin({ | |
autoHttp: true | |
}) | |
] | |
}) | |
let counter = 0 | |
module.exports.handler = iopipe(async (event, context) => { | |
counter++ | |
return { | |
statusCode: 200, | |
body: JSON.stringify({ counter }) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment