Created
July 21, 2020 15:24
-
-
Save fernyettheplant/10c997cda285467f8fb5de7570b8000a 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
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