Created
August 27, 2012 23:57
-
-
Save simianhacker/3493548 to your computer and use it in GitHub Desktop.
Example MySQL API-ish Request
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
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