NodeJS Postgres error getaddrinfo ENOTFOUND
<p>I use <code>pg://user:pass@localhost:port/table</code> for connecting to my AWS database. When I use localhost, the app works fine, but when I try to connect the AWS server it falls apart. </p>

<p>Even a simple connection code gives me this error.
The database name is people and it's running on port 8080 but in this error it's showing 5432 even if I declare the correct port number in the conString.</p>

<blockquote>
  <p>Error: getaddrinfo ENOTFOUND people people:5432
      at errnoException (dns.js:26:10)
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)</p>
</blockquote>

<p>This is my code so far:</p>

<pre><code>var pg = require("pg");

var conString = "pg://someuser:pass@db-endpoint:8080/postgres";
var client = new pg.Client(conString);
client.connect();
</code></pre>