【发布时间】:2019-07-12 16:43:53
【问题描述】:
我使用golang开发了一个rest api。我已经将存储库推送到了Heroku。我还在互联网上托管了一个Mysql Server。Go rest api连接到Mysql Server并获取和插入数据。
heroku 上的应用程序昨天运行良好。但是今天早上我在“heroku logs --tail”上收到此错误:Web process failed to bind to $PORT in 60 seconds of launch
这是 main.go 的代码:
package main
import (
"os"
"github.com/mingrammer/go-todo-rest-api-example/app"
"github.com/mingrammer/go-todo-rest-api-example/config"
)
func main() {
config := config.GetConfig()
app := &app.App{}
app.Initialize(config)
port, ok := os.LookupEnv("PORT")
if ok == false {
port = "3000"
}
app.Run(":"+port)
}
【问题讨论】: