Simple image host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

db.js 370B

1234567891011121314151617181920212223
  1. var pg = require("pg");
  2. module.exports = function(conf, cb) {
  3. var conStr =
  4. "postgres://"+
  5. conf.user+":"+
  6. conf.pass+"@"+
  7. conf.host+"/"+
  8. conf.database;
  9. pg.connect(conStr, function(err, client) {
  10. if (err) return cb(err);
  11. this.client = client;
  12. cb();
  13. }.bind(this));
  14. }
  15. module.exports.prototype = {
  16. query: function(str) {
  17. this.client.query(str);
  18. }
  19. }