diff --git a/cmd/web/main.go b/cmd/web/main.go index 7dbe670..72a33eb 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -16,14 +16,13 @@ import ( var appKey []byte func main() { - var port string + port := "8080" - err := godotenv.Load() - if err != nil { - port = "8080" + godotenv.Load() + + if p := os.Getenv("PORT"); p != "" { + port = p } - - port = os.Getenv("PORT") appKey = []byte(os.Getenv("APP_KEY")) if len(appKey) == 0 { log.Fatal("unable to load APP_KEY")