I'm new and poorly understood right I do. Nowhere else to ask )
OK, I hooked up the dependency npm i pg
. created the file db.js with the connection settings.
in the file routes.js call db and make the query run successfully.
Do I need to close the connection or what ? If I have many controllers to the ranting
and every time I call db - creates a new instance of a connection after all.