【发布时间】:2018-03-27 07:51:38
【问题描述】:
连接到 Firebase 并添加以下域后:
Heroku Domain 到授权域,当我尝试 [Heroku open] 时出现以下错误:
应用程序发生错误,您的页面无法访问 服务。如果您是应用程序所有者,请查看您的日志以了解详细信息。
日志太混乱了:
2017-10-15T19:43:14.249135+00:00 heroku[路由器]: at=error code=H10 desc="应用程序崩溃" 方法=GET path="/favicon.ico" 主机=aqueous-lake-87719.herokuapp.com request_id=c837ed1c-0d44-497b-88d6-0cc72e062771 fwd="197.37.44.69" dyno=连接=服务=状态=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
【问题讨论】:
标签: reactjs firebase heroku webpack firebase-authentication