So, the question is, Wappler, did you break environment variables? NodeJS + Wappler 4.6.3
(spoiler: YES) edit: no
db.json:
# cat app/modules/connections/db.json
{
"name": "db",
"module": "dbconnector",
"action": "connect",
"options": {
"client": "postgres",
"connection": {
"host": "{{$_ENV[DB_HOST]}}",
"port": "{{$_ENV[DB_PORT]}}",
"user": "{{$_ENV[DB_USER]}}",
"password": "{{$_ENV[DB_PASS]}}",
"database": "{{$_ENV[DB_NAME]}}"
}
}
}
Startup command:
PORT=81 DB_HOST=8.8.8.8 node index.js
SQL query:
server-connect:server Got error? Error: connect ECONNREFUSED 127.0.0.1:5432
server-connect:server at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
server-connect:server errno: -111,
server-connect:server code: 'ECONNREFUSED',
server-connect:server syscall: 'connect',
server-connect:server address: '127.0.0.1',
server-connect:server port: 5432
server-connect:server } +3s
Why the hell is this connecting to 127.0.0.1? You clearly see I defined DB_HOST to 8.8.8.8, please tell me I’m not crazy, you broke this, right?
Yep, you broke this