Skip to content

Instantly share code, notes, and snippets.

@simianhacker
Created August 27, 2012 23:57
Show Gist options
  • Save simianhacker/3493548 to your computer and use it in GitHub Desktop.
Save simianhacker/3493548 to your computer and use it in GitHub Desktop.
Example MySQL API-ish Request
var mysql = some_function_to_create_a_mysql_connection();
app.get('/foo', function (req, res) {
mysql.query('SELECT * FROM example', function (err, results) {
if(err) {
res.send(400);
}
res.send(results, 200);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment