Hi I've been trying to deploy my app for the past 3 hours and I can't seem to figure out the issue. I am new to deploying to heroku and after troubleshooting for the past two hours Ive compiled a list of things I've tried from other answers
const PORT = process.env.PORT || 5000;
app.listen(PORT, () => console.log(`Listening on port:${PORT}`))
this is my package.json
{
"name": "todolist",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"repository": {
"type": "git",
"url": "hiding this"
},
"author": "",
"license": "ISC",
"bugs": {
"url": hiding this
},
"homepage": hiding this,
"dependencies": {
"bcrypt": "^5.0.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"jsonwebtoken": "^8.5.1",
"morgan": "^1.10.0",
"mysql2": "^2.2.5",
"pg": "^8.5.1",
"sequelize": "^6.3.5"
},
"devDependencies": {
"sequelize-cli": "^6.2.0"
}
}
This is my config.json
{
"development": {
"database": "todolist_development",
"dialect": "postgres"
},
"test": {
"database": "express_react_auth_test",
"dialect": "postgres"
},
"production": {
"use_env_variable": "DATABASE_URL",
"dialect": "postgres",
"dialectOptions": {
"ssl": true
}
}
}
any help would be so appreciated
You might have forgotten to set your environment variables on heroku. Just put all keys and values you have in your.env into heroku config vars and remember to add db addon in your Heroku app, if you are using mysql I'd recommend to use clearDb.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.