Skip to content

Commit

Permalink
change port to be an integer
Browse files Browse the repository at this point in the history
  • Loading branch information
dhollinger authored and bastelfreak committed May 31, 2023
1 parent 9b994f1 commit eae00b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Config struct {
Protected bool `mapstructure:"protected"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
Port string `mapstructure:"port,int"`
Port int `mapstructure:"port,int"`
TLS struct {
Enabled bool `mapstructure:"enabled"`
Certificate string `mapstructure:"certificate"`
Expand Down
6 changes: 4 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package server

import (
"fmt"

"github.com/voxpupuli/webhook-go/config"
)

Expand All @@ -9,8 +11,8 @@ func Init() {
config := config.GetConfig().Server
r := NewRouter()
if config.TLS.Enabled {
r.RunTLS(":"+config.Port, config.TLS.Certificate, config.TLS.Key)
r.RunTLS(":"+fmt.Sprint(config.Port), config.TLS.Certificate, config.TLS.Key)
} else {
r.Run(":" + config.Port)
r.Run(":" + fmt.Sprint(config.Port))
}
}

0 comments on commit eae00b1

Please sign in to comment.