我正在尝试将我的应用程序部署到Heroku,但一直崩溃。我使用CLI打开我的应用程序,它仍然崩溃,我甚至在Keroku仪表板上部署分支,它仍然崩溃。我想知道我的app.js或packjson出了什么问题。
这是我得到的错误:
2019-06-19T12:32:14.679424 00:00 heroku[路由器]: at=错误码=H10 desc="应用程序崩溃"方法=GET路径="/"主机=guarded-island-18465.herokuapp.comrequest_id=66a60c63-3bad-47ad-8255-85f56798df95fwd="97.99.40.66"dyno=connect=service=status=503 bytes=Protocol=https2019-06-19T12:32:15.283697 00:00 heroku[路由器]: at=错误码=H10 desc="应用程序崩溃"方法=GET路径="/favicon.ico"主机=guarded-island-18465.herokuapp.com=888cb97b-7aaf-4e0b-97c5-d01432d188a6 fwd="97.99.40.66"dyno=connect=service=status=503 bytes=协议=https
{
"name": "newburger2",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jnperk1234/neweatdaburger.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/jnperk1234/neweatdaburger/issues"
},
"homepage": "https://github.com/jnperk1234/neweatdaburger#readme",
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1",
"express-handlebars": "^3.1.0",
"mongodb": "^3.2.6",
"mysql": "^2.17.1"
}
}
var express = require("express");
var bodyParser = require("body-parser");
var exphbs = require("express-handlebars");
var app = express();
var PORT = process.env.PORT || 3000;
app.use(express.static("public"));
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());
app.engine("handlebars", exphbs({
defaultLayout: "main"
}));
app.set("view engine", "handlebars");
var routes = require("./controllers/burgers_controller.js");
app.use(routes);
app.listen(port, "0.0.0.0", function () {
console.log("Listening on Port 3000");
});
检查这个答案
React应用程序在本地运行,在Heroku错误代码= H10时崩溃
希望有帮助
我可以看到您用大写字母声明了端口变量。然而,在最后一行中,它用于小写字母。尝试将其更改为:
app.listen(PORT, "0.0.0.0", function () {
console.log("Listening on Port 3000");
});
事实上,Express会抛出一个引用错误,然后会使Heroku上的服务器崩溃。
这帮助了我。部署时的默认构建包是节点.js。您需要使用创建-反应-应用构建包(如下所示)。
heroku create $APP_NAME --buildpack mars/create-react-app
git push heroku master
heroku open
因此,我阅读了有关部署的内容,并多次尝试在Heroku上部署。不能让它工作。 错误日志: 2017-02-13T04:48:13.132359+00:00Heroku[Web.1]:状态从崩溃更改为启动 2017-02-13T04:48:17.100053+00:00Heroku[Web.1]:使用命令启动进程 2017-02-13T04:48:20.884225+00:00Heroku[Web.
我的应用程序似乎总是在部署后崩溃。 2015-07-21T13:29:28.127452+00:00 Heroku[router]:at=error code=h10 desc=“应用程序崩溃”method=get path=“/api/v1/sessions”host=calm-hamlet-5165.herokuapp.com request_id=69711e3a-913e-45ed-b4b
我有一个错误应用程序在我的本地电脑上工作,但当我把它发送给heroku时,它崩溃了。错误日志给出错误H10&表示: 编辑: 有没有人以前有过这种情况,并且知道是什么导致了这个问题?我找不到解决办法。 多谢了。
我的构建成功,但我的heroku网站返回错误。我使用heroku日志——tail来查看错误消息。下面是它所说的: 2019-01-23T17:33:34.339263 00:00 app[web.1]:File“/app/notetaking/prod\u settings.py”,第4行2019-01-23T17:33:34.339264 00:00 app[web.1]:SECURE\u PR
我在heroku应用程序上部署了一个springboot应用程序。该应用程序运行良好很长一段时间。但现在突然我得到一个错误Code="H10"并且应用程序崩溃。部署到heroku时构建成功,应用程序也可以在本地运行。 应用程序在git存储库中:https://github.com/hmanoharan-12/saloncityservice 我在向API发送请求时出错。例如:-<代码>https:
我的应用程序https://github.com/amyequinn/weatherapp在终端运行npm启动时运行得很好,但是当将应用程序部署到Heroku时,它崩溃了,我找不到解决方案。错误为H10,应用程序在Get方法时崩溃,状态503.... “2020-05-08T23:13:34.132652+00:00 Heroku[router]:at=error code=h10 desc=”A