gpt4 book ai didi

javascript - Heroku App 崩溃状态 503。可能会发生哪些问题?

转载 作者:行者123 更新时间:2023-11-30 19:45:21 25 4
gpt4 key购买 nike

我尝试将全栈应用程序从我的 GitHub 部署到 Heroku,但出现 503 错误,尽管它在本地计算机上运行良好。可能会发生哪些问题?

2019-03-05T09:04:17.530233+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=message-board-byjb.herokuapp.com request_id=0f57c216-cf0e-46fa-a8fd-1e003b29e0ac fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
2019-03-05T09:04:17.999176+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=message-board-byjb.herokuapp.com request_id=420d10af-fd3b-43b7-ab5b-9c925e6e520b fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
2019-03-05T09:06:10.224358+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=message-board-byjb.herokuapp.com request_id=5c7b5ba0-3e8a-4e4c-9a4c-38e7e3c47079 fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
2019-03-05T09:06:10.714879+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=message-board-byjb.herokuapp.com request_id=7eca85fd-6018-41d7-897a-5fbf1b40fcbb fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
2019-03-05T09:06:13.775830+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=message-board-byjb.herokuapp.com request_id=9673bc4f-e6a3-4945-84a4-c2de1a8abef5 fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
2019-03-05T09:06:14.300128+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=message-board-byjb.herokuapp.com request_id=9f7a5839-ea06-4cb7-b465-c74f4b6d23ac fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
2019-03-05T09:06:14.765410+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=message-board-byjb.herokuapp.com request_id=95c16b9d-c257-43d9-9d94-ae6ab13b0fb3 fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
2019-03-05T09:06:15.673564+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=message-board-byjb.herokuapp.com request_id=960484dc-7edb-4975-9d4e-7ad62c153994 fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
2019-03-05T09:22:41.651010+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=message-board-byjb.herokuapp.com request_id=c1be111c-b3bd-47d6-aa15-4b54caf5bbff fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
2019-03-05T09:22:42.127315+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=message-board-byjb.herokuapp.com request_id=682549c5-670e-4542-84d6-400671d623a4 fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https

更新:server.js 的内容:

const express = require("express");
const logger = require("morgan");

const API_PORT = 3001;
const app = express();
const router = require('./routers/board');

app.use(logger("dev"));

app.use('/api', router);

app.listen(API_PORT, () => {
console.log(`LISTENING ON PORT ${API_PORT}`)
});

React 环境使用 3000 端口。该项目由“后端”和“前端”目录组成。在我包含的“前端”目录的 package.json 中

"proxy": "http://localhost:3001"

最佳答案

改变

const API_PORT = 3001;

const API_PORT = process.env.PORT || 3001

关于javascript - Heroku App 崩溃状态 503。可能会发生哪些问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54999746/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com