Skip to content

Instantly share code, notes, and snippets.

@fernyettheplant
Created July 21, 2020 15:26
Show Gist options
  • Save fernyettheplant/9318547f045c0298e3c315c371c9e0df to your computer and use it in GitHub Desktop.
Save fernyettheplant/9318547f045c0298e3c315c371c9e0df to your computer and use it in GitHub Desktop.
module.exports.myhandler = function (event, context, cb) {
conn.query("SELECT * FROM items", (error, results) => {
if (error) {
cb(error, null)
} else {
cb(null, results)
}
})
}
If you are using another kind of client like Feature Flags, the same principle applies!
const LaunchDarkly = require('launchdarkly-node-server-sdk')
const ldClient = LaunchDarkly.init('SDK_KEY')
const ready = ldClient.waitForInitialization()
module.exports.myhandler = function (event, context, cb) {
ready.then((client) => {
// Check yout FF here
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment