title: PostgreSQL node server connecting to local pg rather than cloud (digitalocean)
body: <p>Hi I am trying to connect to Postgres on digital ocean with a node basic server, but every time I hit a api end point like localhost:3001 etc instead of trying to connect to the pg on DO I get connected or try to connect to pg locally.</p>
  <p>The credentials and config params all point to the digital ocean pg so I am not sure why is it trying to connect to the local pg on my Mac. I have a M1 Mac.</p>
  <p>Another question is do I need pg locally installed to connect to DO pg? I removed the pg locally uninstalling everything and tried to connect to DO pg but it won't work, I get an error:</p>
  <pre><code>Error: connect ECONNREFUSED 127.0.0.1:5432
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
    errno: -61,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 5432
  }
  </code></pre>
  <p>The reason I am asking is that I have almost exact logic on a electron node app, with the same configs and params pointing to DO pg and I can connect and fetch data etc it works either with local pg installed or with pg uninstalled locally so I am really confused.</p>
  <p>On the node server I am using node pg npm package, which works fine on my electron app without the need of a local pg installed.</p>
  <p>Please let me know.</p>