Yeah everything in your .env file in your local app you need to add in the heroku dashboard as the .env file isn’t (shouldn’t be) pushed to the github repo which your heroku app is using,
It’s an obvious thing but it’s tripped me up a few times as I’ve just forgot to input them in heroku.
Not sure if that’s the problem just throwing it out there.
I’m not familiar with knex, but isn’t your knexfile.js with config also required in production? I see production key there, but in connection.js file you ignore it in production.
that checks whether I am in production mode and if so it will connect to my production database otherwise it will connect to my (.gitignore’d) knex file
yes sorry, it was just how I was taught to do it. I have another app, where the configs are built in the same way and it hosts fine. that’s why I can’t understand what I am doing wrong here because if anything this is a much smaller app.
so when I run the code in the environment development, it works fine but the moment I change it to production, that’s when I get “internal server error”.
Error: Unable to acquire a connection
at Client_PG.acquireConnection (/Users/jamesgill/Desktop/todoList/Quiz/Quiz-server/node_modules/knex/lib/client.js:339:13)
at Runner.ensureConnection (/Users/jamesgill/Desktop/todoList/Quiz/Quiz-server/node_modules/knex/lib/runner.js:264:8)
it looks like its not connecting to the PG database on heroku. I have tried changing the connectionString in the knexfile.js to the actually Postgres_url string but its still having none of it and will not connect.
good point , I thought it might be with me running pg @ 12 as I was getting a warning saying pg was 12 and server was 13. so updated, that hasn’t worked either