bind address can be configured by environment variables
This commit is contained in:
parent
6e2f5d4b1a
commit
9733bd2f07
5
main.go
5
main.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -85,5 +86,7 @@ func main() {
|
||||||
tmpl.Execute(w, status)
|
tmpl.Execute(w, status)
|
||||||
})
|
})
|
||||||
|
|
||||||
log.Fatal(http.ListenAndServe("127.0.0.1:8000", nil))
|
var address = fmt.Sprintf("%s:%s", os.Getenv("BIND"), os.Getenv("PORT"))
|
||||||
|
|
||||||
|
log.Fatal(http.ListenAndServe(address, nil))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue