Javascript Heroku应用程序崩溃状态503。会出现哪些问题?

Javascript Heroku应用程序崩溃状态503。会出现哪些问题?,javascript,node.js,heroku,deployment,Javascript,Node.js,Heroku,Deployment,我试图将fullstack应用程序从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-1e003

我试图将fullstack应用程序从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
UPD: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端口。该项目由“后端”和“前端”目录组成。在我包含的“frontend”目录的package.json中

"proxy": "http://localhost:3001"
改变

const API_PORT = 3001;


你应该在heroku上查看你的应用程序日志。你能发布app.js文件的内容吗?我的直觉告诉我这要么是你的app.listen有问题,要么是Procfile在本地运行得很好。在终端中运行>heroku logs--tail也将有助于诊断问题。
heroku logs--tail--app your_app_name
将有助于诊断问题。我在项目中添加了“heroku”包。当我在bash中键入此命令时,会得到“bash:heroku:command not found”1)您不应该使用硬编码端口,而是使用heroku默认使用的process.env.port-2)您应该使用“/”路由返回什么?您发布的代码不处理默认路由,只处理'/api'路由
const API_PORT = process.env.PORT || 3001