mirror of
https://github.com/thebaer/cdr.git
synced 2024-11-15 01:31:01 +00:00
Support setting server port with PORT env var
This also logs the address the application is serving on.
This commit is contained in:
parent
a28732063f
commit
82650d00ae
@ -92,5 +92,10 @@ func serveAction(c *cli.Context) error {
|
|||||||
log.Printf("GET /")
|
log.Printf("GET /")
|
||||||
})
|
})
|
||||||
|
|
||||||
return http.ListenAndServe(":9991", nil)
|
port := os.Getenv("PORT")
|
||||||
|
if port == "" {
|
||||||
|
port = "9991"
|
||||||
|
}
|
||||||
|
log.Printf("Serving on http://localhost:%s", port)
|
||||||
|
return http.ListenAndServe(":"+port, nil)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user