This commit is contained in:
Jay 2018-02-12 23:10:45 +08:00
parent c65d29e81a
commit 57a0995c2f
3 changed files with 13 additions and 4 deletions

View File

@ -9,7 +9,6 @@ ws.on('open', () => {
ws.on('message', (data) => {
if (typeof data !== 'string') data = data.toString()
})
ws.on('error', (err) => {

View File

@ -1,2 +1,12 @@
const pg = require('pg')
const {Pool} = require('pg')
const config = require('../config')
const pool = new Pool({
user: config.database.user,
password: config.database.pass || null,
port: config.database.port,
host: config.database.host,
database: config.database.db_name
})
module.exports = pool