random route stuff
This commit is contained in:
parent
d27ff64a74
commit
9a63772401
8 changed files with 143 additions and 124 deletions
13
lib/db.js
13
lib/db.js
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue