diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/config/config.go | 4 | ||||
-rw-r--r-- | internal/server/server.go | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 5ba96d3..75f18d6 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -61,7 +61,7 @@ func mustLocalTime(in string) (time toml.LocalTime) { type Web struct { ContentSecurityPolicy CSP ListenAddress string - Port string + Port int BaseURL URL SentryDSN string Environment string @@ -86,7 +86,7 @@ var defaultConfig = Config{ DataPath: "./data", Web: &Web{ ListenAddress: "localhost", - Port: "3000", + Port: 3000, BaseURL: mustURL("http://localhost:3000"), ContentSecurityPolicy: CSP{ DefaultSrc: []string{"'self'"}, diff --git a/internal/server/server.go b/internal/server/server.go index bb0a6ad..6c4b732 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -8,6 +8,7 @@ import ( "net/http" "searchix/internal/config" "searchix/internal/index" + "strconv" "time" "github.com/pkg/errors" @@ -22,7 +23,7 @@ func New(conf *config.Config, index *index.ReadIndex, liveReload bool) (*Server, if err != nil { return nil, err } - listenAddress := net.JoinHostPort(conf.Web.ListenAddress, conf.Web.Port) + listenAddress := net.JoinHostPort(conf.Web.ListenAddress, strconv.Itoa(conf.Web.Port)) return &Server{ &http.Server{ |