Skip to content

Instantly share code, notes, and snippets.

@eggie5
Created August 6, 2010 21:49
Show Gist options
  • Save eggie5/512065 to your computer and use it in GitHub Desktop.
Save eggie5/512065 to your computer and use it in GitHub Desktop.
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