0

Visual Studio / Azure Functions / NodeJs / Postgresql / LocalHost / MacBook

When I try to connect to my local Postgres database It works but each time I get this message in Visual Studio

enter image description here

My Code : index.js

module.exports = async function (context, req) { const pg = require('pg'); const config = { host: 'localhost', user: 'postgres', password: 'myPassword', database: 'myDataBase', port: 5432 }; const client = new pg.Client(config); client.connect(err => { if (err) { console.log('Error : ',err) } else { const query = 'select * from public.user'; client.query(query) .then(res => { const rows = res.rows; rows.map(row => { console.log(`Read: ${JSON.stringify(row)}`); }); process.exit(); }) .catch(err => { console.log(err); }); } }); } 
2
  • Hi, may I know if your problem was solved ? Commented Mar 31, 2020 at 2:02
  • @HuryShen No, I'm using from Postman and I don't have the problem now Commented Mar 31, 2020 at 4:42

1 Answer 1

0

You can have a try to disable chrome run on background or do the operation of "Debug" --> "Options" --> disable the option "Enable JavaScript debugging for ASP.NET(Chrome, Edge and IE)".

enter image description here

This post may help with your problem.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.