all repos — searchix @ f42dfe7b5fd3d60c9558eb520d33c7c8fd1ba201

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: format server listen address as URL
Alan Pearce alan@alanpearce.eu
Thu, 09 May 2024 19:30:02 +0200
commit

f42dfe7b5fd3d60c9558eb520d33c7c8fd1ba201

parent

830e14f372fcff094448ac8528386ab381f6f35c

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M serve/main.goserve/main.go
@@ -4,6 +4,7 @@ import ( 	"fmt"
 	"log"
 	"log/slog"
+	"net/url"
 	"os"
 	"os/signal"
 	"sync"
@@ -56,7 +57,8 @@ defer wg.Done() 		sErr <- sv.Start()
 	}()
 	if !runtimeConfig.InDevServer {
-		log.Printf("server listening on %s", sv.Addr)
+		url, _ := url.Parse("http://" + sv.Addr)
+		log.Printf("server listening on %s", url.String())
 	}
 
 	err = <-sErr