我已经创建了一个React应用程序,并且在我的localhost:3000上运行正常,但是在尝试将其部署到Heroku时失败了。 我显示的错误:
DelayReturnToHomePage = (e) => {
setTimeout(() => {
this.props.history.push({
pathname: '/'
})
}, 1700)
}
handleSaveData(){
this.setState({
saveDataClicked: 'yes'
})
if(this.state.live == 1)
{
fetch(`http://ca-fpscfb2:4000/SaveDataRedFlags?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&redFlags=${Base64.encode(this.state.redFlagContent)}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataMaintenanceReleases?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&maintenanceReleases=${Base64.encode(this.state.maintenanceContent)}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataNotes?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}¬es=${Base64.encode(this.state.notesContent)}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataStatus?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&status=${Base64.encode(this.state.selectedOption.value)}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataSummary?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&summary=${this.state.summaryLiveOn}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataStatusColor?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&statuscolor=${this.state.selectedOption.label}`)
.then(
this.setState({showSaveModal: true}),
setTimeout(() => {
this.handleSaveDataHide();
}, 3000)
)
}
else
{
fetch(`http://ca-fpscfb2:4000/SaveDataRedFlags?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&redFlags=${Base64.encode(this.state.redFlagContent)}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataMaintenanceReleases?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&maintenanceReleases=${Base64.encode(this.state.maintenanceContent)}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataNotes?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}¬es=${Base64.encode(this.state.notesContent)}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataStatus?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&status=${Base64.encode(this.state.selectedOption.value)}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataSummary?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&summary=${this.state.summaryLiveOff}`) &&
fetch(`http://ca-fpscfb2:4000/SaveDataStatusColor?dashboardID=${this.state.dashboardID}&airlineID=${this.state.airlineID}&statuscolor=${this.state.selectedOption.label}`)
.then(
this.setState({showSaveModal: true}),
setTimeout(() => {
this.handleSaveDataHide();
}, 3000)
)
}
}
我的heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=stark-wave-46792.herokuapp.com request_id=bcf25382-90d2-4d27-a4ff-423bd990c864 fwd="103.242.197.11" dyno= connect= service= status=503 bytes= protocol=https
脚本如下:
package.json
我的server.js看起来像这样: