Created
August 6, 2010 21:49
-
-
Save eggie5/512065 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
var app = require('express').createServer(); | |
cs="postgres://asdf:@localhost/dogs" | |
var postgres = require('./lib/postgres-js/lib/postgres-pure'); | |
var db = new postgres.Connection(cs); | |
app.get('/dd', function(req, res){ | |
db.query("SELECT * FROM dogs;", function (data) { | |
res.send(JSON.stringify(data), { 'Content-Type': 'application/json' }, 200); | |
}); | |
}); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment