[英]First time deploying an express backend to Heroku 2 error code h10 Process exited with status 1
嗨,過去 3 小時我一直在嘗試部署我的應用程序,但我似乎無法解決問題。 我是部署到 heroku 的新手,在過去兩個小時的故障排除后,我整理了一份我從其他答案中嘗試過的事情的清單
const PORT = process.env.PORT || 5000;
app.listen(PORT, () => console.log(`Listening on port:${PORT}`))
這是我的 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"
}
}
這是我的配置。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
}
}
}
任何幫助將不勝感激
您可能忘記在 heroku 上設置環境變量。 只需將您在 your.env 中的所有鍵和值放入 heroku 配置變量中,並記住在 Heroku 應用程序中添加 db 插件,如果您使用的是 mysql,建議使用 clearDb52EZ I'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.