连接到Firebase并添加以下域名后:
Heroku Domain到授权域,当我尝试[Heroku open
]时出现以下错误:
应用程序中发生错误,您的页面无法执行 提供服务。如果您是应用程序所有者,请检查日志以获取详细信息。
日志非常混乱:
2017-10-15T19:43:14.249135 + 00:00 heroku [router]:at = error code = H10 desc =" App崩溃" method = GET path =" /favicon.ico" 主机= aqueous-lake-87719.herokuapp.com request_id = c837ed1c-0d44-497b-88d6-0cc72e062771 fwd =" 197.37.44.69" dyno = connect = service = status = 503 bytes = protocol = 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