[英]First time deploying an express backend to Heroku 2 error code h10 Process exited with status 1
Hi I've been trying to deploy my app for the past 3 hours and I can't seem to figure out the issue.嗨,过去 3 小时我一直在尝试部署我的应用程序,但我似乎无法解决问题。 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
我是部署到 heroku 的新手,在过去两个小时的故障排除后,我整理了一份我从其他答案中尝试过的事情的清单
const PORT = process.env.PORT || 5000;
app.listen(PORT, () => console.log(`Listening on port:${PORT}`))
this is my package.json这是我的 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这是我的配置。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
}
}
}
this is my folder structure这是我的文件夹结构
any help would be so appreciated任何帮助将不胜感激
You might have forgotten to set your environment variables on heroku.您可能忘记在 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.
只需将您在 your.env 中的所有键和值放入 heroku 配置变量中,并记住在 Heroku 应用程序中添加 db 插件,如果您使用的是 mysql,建议使用 clearDb52EZ I'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.