node_postgres/script.js

14 lines
290 B
JavaScript

const pg = require('pg')
const client = new pg.Client({
user: 'api',
host: '192.168.1.110',
database: 'ubm',
password: 'qqqx53!028',
port: 5433,
})
client.connect()
client.query('SELECT * from pg_stat_activity', (err, res) => {
console.log(err, res)
client.end()
})