Trouble Accessing Remote Postgres DB on Heroku from Local Node.js Webapp
问题 I struggled today to get my local node.js app to reach out to the db on Heroku instead of settling for a parallel db on my machine. Thanks to a post I tested and then stopped expecting process.env.DATABASE_URL to provide the URL and replaced it with the actual URL from heroku config along the lines of var connectionString = "postgres://thinga:thingb@ec2-23-21-119-36.compute-1.amazonaws.com:5432/thingc"; . But that didn't solve the problem completely. I found I also had to use var pg = require