about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-04-25 12:58:53 +0200
committerAlan Pearce2024-04-25 13:02:02 +0200
commitfd67b19b5c7f76f0c3579e8a05ef20a618e90be7 (patch)
tree89b7b064ee82b371d3079c39008f866263b1e4b9
parentc798e8e736c0649008cade337158399470a9099b (diff)
downloadwebsite-fd67b19b5c7f76f0c3579e8a05ef20a618e90be7.tar.lz
website-fd67b19b5c7f76f0c3579e8a05ef20a618e90be7.tar.zst
website-fd67b19b5c7f76f0c3579e8a05ef20a618e90be7.zip
server: make port a string, which is what go uses
-rw-r--r--internal/server/server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 5d45de2..d414d71 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -26,7 +26,7 @@ var config *cfg.Config
 type Config struct {
 	Production             bool    `conf:"default:false"`
 	ListenAddress          string  `conf:"default:localhost"`
-	Port                   uint16  `conf:"default:3000,short:p"`
+	Port                   string  `conf:"default:3000,short:p"`
 	BaseURL                cfg.URL `conf:"default:http://localhost:3000,short:b"`
 	RedirectOtherHostnames bool    `conf:"default:false"`
 }
@@ -166,6 +166,6 @@ func Start(runtimeConfig *Config) {
 		w.WriteHeader(http.StatusOK)
 	})
 
-	listenAddress := net.JoinHostPort(runtimeConfig.ListenAddress, fmt.Sprint(runtimeConfig.Port))
+	listenAddress := net.JoinHostPort(runtimeConfig.ListenAddress, runtimeConfig.Port)
 	log.Fatal(http.ListenAndServe(listenAddress, nil))
 }