Hey there.
I am at the point of the first exercise for pg.
I have my docker container running at port 5444. I can query it and everything works in psql.
When I try to go to ingredients in the node app I get in the terminal:
`const error = this._ending ? new Error('Connection terminated') : new Error('Connection terminated unexpectedly')
^
Error: Connection terminated unexpectedly
at Connection. (C:\Users\Slav\Downloads\sql\sql-apps\node_modules\pg\lib\client.js:132:73)
at Object.onceWrapper (node:events:632:28)
at Connection.emit (node:events:518:28)
at Socket. (C:\Users\Slav\Downloads\sql\sql-apps\node_modules\pg\lib\connection.js:107:12)
at Socket.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)`
and in the console:
GET http://localhost:3000/ingredients/type?type=fruit net::ERR_CONNECTION_REFUSED
requestFromAPI @ client.js:40
init @ client.js:72
(anonymous) @ client.js:130Understand this error
client.js:40 Uncaught (in promise) TypeError: Failed to fetch
at requestFromAPI (client.js:40:21)
at init (client.js:72:23)
at client.js:130:1
Why would this happen?
Hey there.
I am at the point of the first exercise for pg.
I have my docker container running at port 5444. I can query it and everything works in psql.
When I try to go to ingredients in the node app I get in the terminal:
`const error = this._ending ? new Error('Connection terminated') : new Error('Connection terminated unexpectedly')
^
Error: Connection terminated unexpectedly
at Connection. (C:\Users\Slav\Downloads\sql\sql-apps\node_modules\pg\lib\client.js:132:73)
at Object.onceWrapper (node:events:632:28)
at Connection.emit (node:events:518:28)
at Socket. (C:\Users\Slav\Downloads\sql\sql-apps\node_modules\pg\lib\connection.js:107:12)
at Socket.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)`
and in the console:
GET http://localhost:3000/ingredients/type?type=fruit net::ERR_CONNECTION_REFUSED
requestFromAPI @ client.js:40
init @ client.js:72
(anonymous) @ client.js:130Understand this error
client.js:40 Uncaught (in promise) TypeError: Failed to fetch
at requestFromAPI (client.js:40:21)
at init (client.js:72:23)
at client.js:130:1
Why would this happen?