Skip to content

Instantly share code, notes, and snippets.

@mitechie
Created May 26, 2011 15:08
Show Gist options
  • Save mitechie/993332 to your computer and use it in GitHub Desktop.
Save mitechie/993332 to your computer and use it in GitHub Desktop.
#31 node-postgres
var net = require('net'),
pg = require('pg'),
inspect = require('sys').inspect;
var LISTEN_PORT = 8888,
DBSTRING = "tcp://nocontact:nocontact@localhost/nocontact";
var commands = {
'check': function (email) {
console.log('in check');
pg.connect(DBSTRING, function(err, client) {
console.log('connect');
if (err) {
console.log("ERROR DB " + err.message);
}
});
}
};
console.log('running');
setInterval(function () {
console.log('calling');
commands.check('rharding');
}, 1000);
console.log('interval set');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment