diff options
author | Wim <wim@42.be> | 2018-02-21 00:49:10 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-02-21 00:49:10 +0100 |
commit | 5f3b6ec007c8f3ff9e6d1f0d89f45819fbefd1cf (patch) | |
tree | eee2695e35f667a7077869403121e298fb20a64e /bridge/api | |
parent | 55ab0c12f12e2f0ee15dccd519e1fca4d011b73b (diff) | |
download | matterbridge-msglm-5f3b6ec007c8f3ff9e6d1f0d89f45819fbefd1cf.tar.gz matterbridge-msglm-5f3b6ec007c8f3ff9e6d1f0d89f45819fbefd1cf.tar.bz2 matterbridge-msglm-5f3b6ec007c8f3ff9e6d1f0d89f45819fbefd1cf.zip |
Disable echo banner and output (api)
Diffstat (limited to 'bridge/api')
-rw-r--r-- | bridge/api/api.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bridge/api/api.go b/bridge/api/api.go index cbea9eee..531315a8 100644 --- a/bridge/api/api.go +++ b/bridge/api/api.go @@ -3,9 +3,9 @@ package api import ( "encoding/json" "github.com/42wim/matterbridge/bridge/config" - log "github.com/sirupsen/logrus" "github.com/labstack/echo" "github.com/labstack/echo/middleware" + log "github.com/sirupsen/logrus" "github.com/zfjagann/golang-ring" "net/http" "sync" @@ -36,6 +36,8 @@ func init() { func New(cfg *config.BridgeConfig) *Api { b := &Api{BridgeConfig: cfg} e := echo.New() + e.HideBanner = true + e.HidePort = true b.Messages = ring.Ring{} b.Messages.SetCapacity(b.Config.Buffer) if b.Config.Token != "" { @@ -47,6 +49,10 @@ func New(cfg *config.BridgeConfig) *Api { e.GET("/api/stream", b.handleStream) e.POST("/api/message", b.handlePostMessage) go func() { + if b.Config.BindAddress == "" { + flog.Fatalf("No BindAddress configured.") + } + flog.Infof("Listening on %s", b.Config.BindAddress) flog.Fatal(e.Start(b.Config.BindAddress)) }() return b |