連接到火力地堡後,並添加以下領域: Heroku Domain到授權域,我得到以下錯誤,當我嘗試[Heroku open
]:不開的Heroku應用程序可以連接到火力
錯誤發生在應用程序和您的頁面不能 送達。如果您是應用程序所有者,請查看日誌以獲取詳細信息。
日誌是如此混亂:
2017-10-15T19:43:14.249135 + 00:00的Heroku [路由器]:在=錯誤代碼= H10 DESC =「應用crashed「method = GET path =」/ favicon.ico「 host = aqueous-lake-87719.herokuapp.com request_id = c837ed1c-0d44-497b-88d6-0cc72e062771 fwd =」197.37.44.69「 dyno = connect = service =狀態= 503字節=協議= http
我的package.json:
"name": "boilerplate",
"version": "1.0.0",
"description": "Simple react application",
"main": "index.js",
"scripts": {
"test": "NODE_ENV=test karma start",
"build": "webpack",
"start": "npm run build && node server.js"
},
我server.js:
var express = require('express');
// Create our app
var app = express();
const PORT = process.env.PORT || 3000;
app.use(function (req, res, next){
if (req.headers['x-forwarded-proto'] === 'https') {
res.redirect('http://' + req.hostname + req.url);
} else {
next();
}
});
app.use(express.static('public'));
app.listen(PORT, function() {
console.log('Express server is up on port ' + PORT);
});
在Github上的應用: React-Todo