diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-08-27 21:34:53 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-08-27 21:34:53 +0100 |
commit | 0424ea77d6c09624f35c291a68dde60ea9ca8453 (patch) | |
tree | faa0ddda5b5e9e95993bc0af744d3d65c064c731 /cmd/cashierd | |
parent | 921818bca208f0c70e85ec670074cb3905cbbc82 (diff) |
Allow setting some config from environment
Diffstat (limited to 'cmd/cashierd')
-rw-r--r-- | cmd/cashierd/main.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/cashierd/main.go b/cmd/cashierd/main.go index b29cd75..e3aec93 100644 --- a/cmd/cashierd/main.go +++ b/cmd/cashierd/main.go @@ -334,7 +334,8 @@ func main() { } } - l, err := net.Listen("tcp", fmt.Sprintf("%s:%d", config.Server.Addr, config.Server.Port)) + laddr := fmt.Sprintf("%s:%d", config.Server.Addr, config.Server.Port) + l, err := net.Listen("tcp", laddr) if err != nil { log.Fatal(err) } @@ -399,7 +400,7 @@ func main() { r.PathPrefix("/").Handler(http.FileServer(static.FS(false))) h := handlers.LoggingHandler(logfile, r) - log.Print("Starting server...") + log.Printf("Starting server on %s", laddr) s := &http.Server{ Handler: h, } |