Created
July 21, 2020 15:26
-
-
Save fernyettheplant/9318547f045c0298e3c315c371c9e0df to your computer and use it in GitHub Desktop.
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
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