#postgres
24 messages · Page 1 of 1 (latest)
Project ID: 6a130fdb-576f-4486-9530-f65d39dfcf76
The Railway PostgreSQL database service allows you to provision and connect to a PostgreSQL database with zero configuration. When you run railway run in a project with the Postgres database service installed, we inject several environment variables. PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, DATABASE_URL.
What port is your app listening on?
I've tried having it set to the suggested 0.0.0.0 as well as 4000 which was my original PORT in my .env
You should run it on 0.0.0.0:4000, assuming you have 4000 set as the PORT in your Railway variables.
hmm still running into some issues, would that be the PORT or the DB PORT or both?
The PORT.
check the logs, this is the default error message. Click the dots.
this is what I'm seeing on the deploy logs I have dotenv installed as well. when I check the build logs it was built sucsessfully and I dont have any errors
Can you send over a copy of your package.json?
heres the package.json
"name": "costanza-api-2.0",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"env": "^0.0.2",
"express": "^4.18.2",
"nodemon": "^2.0.20",
"pg": "^8.9.0"
}
}
Looking
build logs said sucsessfully built but I agree ha
thank you!
hmmm- your package lock doesn't have dotenv
can you delete your lock file?
then run npm i?
oh my fault I think I sent package.json
package.-lock.json has
{
"name": "costanza-api-2.0",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "costanza-api-2.0",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"env": "^0.0.2",
"express": "^4.18.2",
"nodemon": "^2.0.20",
"pg": "^8.9.0"
}
},
No thats not the lock.
Essentially you wanna delete and regen this: https://github.com/drew-anello/costanza-api-2.0/blob/master/package-lock.json
With that said: it seems like an issue you can solve and not a Railway builder issue.
I can tell you got this 🙂
thank you just deleted and reinstalled, going to try again