Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PostgresToSNSWorker
// Basic PostgresToSNSWorker worker
const pg = require ('pg');
const pgConString = process.env.POSTGRESQL_CONNECTIONSTRING;
pg.connect(pgConString, function(err, client) {
if(err) {
console.log(err);
}
client.on('notification', function(msg) {
// @todo send message to AWS SNS
console.log(msg);
});
const query = client.query("LISTEN watchers");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment