Categories
JavaScript Answers

How to fix ECONNREFUSED for Postgres on Node.js with error Docker?

Spread the love

To fix ECONNREFUSED for Postgres on Node.js with error Docker, we make sure the connection string is correct.

For instance, we write

DATABASE_URL: postgres://username:pgpassword@db:5432/mydatabase

to set the DATABASE_URL environment variable to a connection string for postgres.

We add the username and password with the database name in the string.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *