node_postgres/script.js

22 lines
490 B
JavaScript
Raw Normal View History

2020-11-27 01:05:10 -05:00
require('dotenv').config();
const express = require('express');
var https = require('https');
var bodyParser = require('body-parser');
const server = express();
var fs = require('fs');
var readline = require('readline');
2020-11-27 01:02:31 -05:00
const pg = require('pg')
const client = new pg.Client({
2020-11-27 01:01:42 -05:00
user: 'api',
host: '192.168.1.110',
database: 'ubm',
2020-11-27 01:01:42 -05:00
password: 'qqqx53!028',
port: 5433,
})
client.connect()
2020-11-27 01:05:10 -05:00
client.query('SELECT 1', (err, res) => {
console.log(err, res)
client.end()
})