第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Heroku Go 應(yīng)用程序崩潰

Heroku Go 應(yīng)用程序崩潰

Go
江戶(hù)川亂折騰 2021-11-08 10:54:42
按照本教程,一切都在本地進(jìn)行。將我的應(yīng)用程序部署到 Heroku 并在瀏覽器上訪(fǎng)問(wèn)該應(yīng)用程序后,我收到503 錯(cuò)誤和消息:應(yīng)用程序錯(cuò)誤 應(yīng)用程序發(fā)生錯(cuò)誤,無(wú)法提供您的頁(yè)面。請(qǐng)稍后重試。如果您是應(yīng)用程序所有者,請(qǐng)檢查您的日志以了解詳細(xì)信息。日志說(shuō):2015-09-08T16:31:53.976824+00:00 heroku[web.1]: State changed from crashed to starting2015-09-08T16:31:56.174376+00:00 heroku[web.1]: Starting process with command `mywebsite`2015-09-08T16:31:59.312461+00:00 app[web.1]: Listening on port: 394612015-09-08T16:32:56.471550+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch2015-09-08T16:32:56.471550+00:00 heroku[web.1]: Stopping process with SIGKILL2015-09-08T16:32:57.390752+00:00 heroku[web.1]: Process exited with status 1372015-09-08T16:32:57.404208+00:00 heroku[web.1]: State changed from starting to crashed2015-09-08T16:32:57.645135+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=boiling-eyrie-6897.herokuapp.com request_id=ec26... fwd="xx.xxx.xxx.xxx" dyno= connect= service= status=503 bytes=2015-09-08T16:32:58.233774+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=boiling-eyrie-6897.herokuapp.com request_id=ef40...fwd="xx.xxx.xxx.xxx" dyno= connect= service= status=503 bytes=我明白錯(cuò)誤是什么,但這么小的教程應(yīng)用程序怎么會(huì)導(dǎo)致啟動(dòng)超時(shí)(R10)?如何更好地調(diào)試并修復(fù)應(yīng)用程序以使其運(yùn)行?
查看完整描述

2 回答

?
梵蒂岡之花

TA貢獻(xiàn)1900條經(jīng)驗(yàn) 獲得超5個(gè)贊

當(dāng)您通過(guò)heroku部署應(yīng)用程序時(shí),它不允許您指定端口號(hào)。
換句話(huà)說(shuō),您不能將 Web 服務(wù)的端口號(hào)指定為8000或其他,heroku 在運(yùn)行時(shí)決定端口號(hào)。
因此,您不能使用以下代碼:

    log.Fatal(http.ListenAndServe(":8000", router))

您可以做的是獲取heroku 的運(yùn)行時(shí)端口。
簡(jiǎn)而言之,只需使用以下代碼

    log.Fatal(http.ListenAndServe(":" + os.Getenv("PORT"), router))


查看完整回答
反對(duì) 回復(fù) 2021-11-08
?
偶然的你

TA貢獻(xiàn)1841條經(jīng)驗(yàn) 獲得超3個(gè)贊

您的應(yīng)用程序需要偵聽(tīng)所有網(wǎng)絡(luò)連接。如果它只偵聽(tīng)本地主機(jī),heroku 的進(jìn)程觀察器將無(wú)法檢測(cè)到您綁定了端口,也無(wú)法向您的應(yīng)用程序發(fā)送請(qǐng)求。

這意味著而不是:

http.ListenAndServe("127.0.0.1:"+port, nil)

您需要致電:

http.ListenAndServe(":"+port, nil)

另請(qǐng)參閱 Heroku 開(kāi)始使用 Go 應(yīng)用程序:https : //github.com/heroku/go-getting-started/blob/master/cmd/go-getting-started/main.go#L27


查看完整回答
反對(duì) 回復(fù) 2021-11-08
  • 2 回答
  • 0 關(guān)注
  • 212 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)