about summary refs log tree commit diff stats
path: root/cmd/server/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/server/main.go')
-rw-r--r--cmd/server/main.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 2f1674e..be36e3b 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -6,11 +6,11 @@ import (
 	"os"
 	"os/signal"
 
-	"website/internal/log"
-	"website/internal/server"
+	"go.alanpearce.eu/website/internal/server"
+	"go.alanpearce.eu/x/log"
 
 	"github.com/ardanlabs/conf/v3"
-	"github.com/pkg/errors"
+	"gitlab.com/tozd/go/errors"
 )
 
 func main() {
@@ -23,7 +23,11 @@ func main() {
 		}
 		panic("parsing runtime configuration" + err.Error())
 	}
-	log.Configure(!runtimeConfig.Development)
+	log := log.Configure(!runtimeConfig.Development)
+
+	if listenAddress := runtimeConfig.ListenAddress; listenAddress[0] == '[' {
+		runtimeConfig.ListenAddress = listenAddress[1 : len(listenAddress)-1]
+	}
 
 	if runtimeConfig.Development {
 		tmpdir, err := os.MkdirTemp("", "website")
@@ -34,7 +38,7 @@ func main() {
 		runtimeConfig.Root = tmpdir
 	}
 
-	sv, err := server.New(&runtimeConfig)
+	sv, err := server.New(&runtimeConfig, log)
 	if err != nil {
 		log.Error("could not create server", "error", err)