allow env var PORT to override listen address flag for Cloud RUN, etc

This commit is contained in:
Antoni Sawicki 2020-04-27 01:05:02 -07:00
parent c80cb876ce
commit b90300ba2d

3
wrp.go
View File

@ -401,6 +401,9 @@ func main() {
} else {
headless = true
}
if len(os.Getenv("PORT")) > 0 {
addr = ":" + os.Getenv(("PORT"))
}
n, err := fmt.Sscanf(fgeom, "%dx%dx%d", &defgeom.w, &defgeom.h, &defgeom.c)
if err != nil || n != 3 {
log.Fatalf("Unable to parse -g geometry flag / %s", err)