Skip to content

Instantly share code, notes, and snippets.

@fernyettheplant
Created July 21, 2020 15:24
Show Gist options
  • Save fernyettheplant/10c997cda285467f8fb5de7570b8000a to your computer and use it in GitHub Desktop.
Save fernyettheplant/10c997cda285467f8fb5de7570b8000a to your computer and use it in GitHub Desktop.
const mysql = require('mysql')
module.exports.myhandler = function (event, context, cb) {
const conn = mysql.createConnection({
// mysql connection info
});
conn.query("SELECT * FROM items", (error, results) => {
if (error) {
cb(error, null)
} else {
cb(null, results)
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment