Make listen port configurable (#230)

Co-authored-by: Tobias Hess <tobias.hess@energiekoppler.com>
This commit is contained in:
hesstobi
2021-02-01 21:10:50 +01:00
committed by GitHub
parent 8be8244b13
commit 6c6f75e80d
4 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package main
import (
"fmt"
"net/http"
internal "github.com/thomseddon/traefik-forward-auth/internal"
@ -25,6 +26,6 @@ func main() {
// Start
log.WithField("config", config).Debug("Starting with config")
log.Info("Listening on :4181")
log.Info(http.ListenAndServe(":4181", nil))
log.Infof("Listening on :%d", config.Port)
log.Info(http.ListenAndServe(fmt.Sprintf(":%d", config.Port), nil))
}