I am just started learning node js. I am trying to host a firebase function. But when I query database (PGSQL using node pg) I am getting forever loading. Please see my code..
exports.myfunction = async(req, res) => {
const {Client} = require('pg');
const client = new Client({
user: "dfgdfgdfg",
host: "IP Address given",
database: "sdfdsfsd",
password: "fsdfdsf",
port: "54321",
});
// res.send('hi'); works fine here
const rest = await client.query("SELECT id,unique_withdraw_id,asset_id,amount,address FROM withdrawals WHERE transfer_network = $1 AND status=$2 LIMIT $3",
['ETH', 'Accepted', 20]);
// res.send('hi'); does not work here, the browser keeps loading...
}