I tried to deploy the fullstack app from my GitHub to Heroku but got 503 error though it works fine on local puter. Which issues can occur?
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 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 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 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 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 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 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 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 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 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 request_id=682549c5-670e-4542-84d6-400671d623a4 fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
UPD: Contents of 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 environment uses 3000 port. The project consist of "backend" and "frontend" directories. In package.json of "frontend" directory I included
"proxy": "http://localhost:3001"
I tried to deploy the fullstack app from my GitHub to Heroku but got 503 error though it works fine on local puter. Which issues can occur?
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. 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. 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. 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. 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. 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. 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. 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. 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. 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. request_id=682549c5-670e-4542-84d6-400671d623a4 fwd="85.26.235.56" dyno= connect= service= status=503 bytes= protocol=https
UPD: Contents of 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 environment uses 3000 port. The project consist of "backend" and "frontend" directories. In package.json of "frontend" directory I included
"proxy": "http://localhost:3001"
Share
Improve this question
edited Mar 5, 2019 at 10:18
JohnByte
asked Mar 5, 2019 at 9:43
JohnByteJohnByte
3093 silver badges10 bronze badges
6
- you should check your app log on heroku. – Panther Commented Mar 5, 2019 at 9:47
- Can you post the contents of your app.js file? My intuition tells me its either an issue with your app.listen or Procfile if it works perfectly fine locally. Running > heroku logs --tail in your terminal will also help in diagnosing the problem. – Jae Park Commented Mar 5, 2019 at 9:54
-
heroku logs --tail --app your_app_name
will help you to diagnose the problem. – narayansharma91 Commented Mar 5, 2019 at 10:02 - I added "heroku" package into the project. When I type this mand in bash, I get "bash: heroku: mand not found" – JohnByte Commented Mar 5, 2019 at 10:26
- 1) You shouldn't use an hardcoded port but instead the process.env.PORT which heroku uses by default - 2) what should you return with the '/' route? By the code you post the default route is not handled, only the '/api' one – SylvainF Commented Mar 5, 2019 at 11:06
1 Answer
Reset to default 5Change
const API_PORT = 3001;
to
const API_PORT = process.env.PORT || 3001
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745412025a4626578.html
评论列表(0条)