Neatening up with more environment vars.
This commit is contained in:
+4
-1
@@ -62,7 +62,10 @@ func main() {
|
|||||||
|
|
||||||
// We run it in a goroutine so it doesn't block main from reaching the signal listener.
|
// We run it in a goroutine so it doesn't block main from reaching the signal listener.
|
||||||
go func() {
|
go func() {
|
||||||
addr := ":3000"
|
addr := os.Getenv("SERVER_PORT")
|
||||||
|
if connStr == "" {
|
||||||
|
log.Fatal("SERVER_PORT environment variable is not set")
|
||||||
|
}
|
||||||
fmt.Printf("Server starting on %s\n", addr)
|
fmt.Printf("Server starting on %s\n", addr)
|
||||||
|
|
||||||
if err := server.Start(addr); err != nil && err != http.ErrServerClosed {
|
if err := server.Start(addr); err != nil && err != http.ErrServerClosed {
|
||||||
|
|||||||
Reference in New Issue
Block a user