random route stuff

This commit is contained in:
Josh Harvey 2016-12-21 19:51:20 +02:00
parent d27ff64a74
commit 9a63772401
8 changed files with 143 additions and 124 deletions

View file

@ -1,4 +1,13 @@
const pgp = require('pg-promise')()
const Pgp = require('pg-promise')
const psqlUrl = require('../lib/options').postgresql
const logger = require('./logger')
module.exports = pgp(psqlUrl)
const pgp = Pgp({
pgNative: true,
error: (_, e) => {
if (e.cn) logger.error('Database not reachable.')
}
})
const db = pgp(psqlUrl)
module.exports = db